Nextcloud only syncing Calendars

I just added a nextcloud account and allowed it all the services listed in the settings applications.

After this I expected that my contacts, pictures and videos from my phone would start appearing on my nextcloud instance while I would start seeing my calendars from nextcloud.

The calendars have appeared and I can interact with them from the phone but other that that not a single contact, picture or video has been synced.

Am I missing something?

(SFOS, nextcloud 27 [fresh&clean install])

Picrures or Videos are not synced but you should have a new category in Gallery where you can browse them (online).

Also you can now “share” files from phone to NC, which is uploading them.

1 Like

That seems to kind of miss the point, am I now to manually share all the thousands of pictures and videos I took?

What about the contacts will they eventually sync?

Contants will sync if the connection is set up correctly. From my experience contact synch is reliable only from cloud to phone. Contacts created on phone can lead to duplicates in the cloud, at least in my case. I avoid that.

File synchronization (for pictures, videos) may be set up using the SailSync ownCloud app from Openrepos. This is my most-used app I think, it works very well in both directions. Very reliable even with folder structures containing thousands of files.

1 Like

I’m going to check out SailSync ownCloud but have to say that is kind of the functionality one would expect in the built in client too :disappointed:

What do you mean by “if the connection is set up correctly”? Should I just be adding a CardDAV account in addition to the Nextcloud account?

I have years of contacts on my phone (migrated from Symbian → nokia n900 → JP1 → n9 → JP1 → X → 10ii) and phone → nextcloud would be the direction I want.

There’s no need to set up an additional Carddav account, simply check contacts sync in Nextcloud account settings. Maybe it’s necessary to add account details such as webdav paths (advanced settings). However, in my case contacts synchronization works with default settings, without any address book path.
I have also a long history of contacts, but I never rely on a phone as a single point of truth for such important data. Instead, I have always had some cloud to store them, be it “Nokia Suite”, MS Exchange, or now Nextcloud. My phone is only one device that synchronizes data with that cloud.

IIRC I had to export all contacts from my phone, import them to NextCloud, remove the contacts from my phone and then add the account. There’s no (easy) way to move a contact from one storage to another in-phone.

And, when you add new contacts, make sure the correct storage is selected on the dialog.

Once it’s set up, it works very well!

1 Like

I’m starting to suspect there is an issue with nextcloud because my wifes Android device also does not sync it’s contacts, will check with some other clients.

This is what I recently had to do as well. I also had to export the ‘Personal Calendar’ on the phone, import to NC and then sync.

For syncing other things, I wanted more control, so I’m using rclone like:

but I have another endpoint in addition for NC. I organize images, for instance, in folders so simple syncing isn’t for me.

EDIT: [Guide/Hack] Automatic Nextcloud file sync when directory contents change - #11 by nephros is a nice overview fro nextcloud from @nephros

gnome-contacts was able to enumerate and show the contents of the nextcloud addressbooks without any issues.

From trailing logs on my server I see that my phone (SFOS) is enumerating the various available addressbooks but then it doesn’t do anything with them, I also tried to pin the phone to a specific address book and it enumerates it but it does not push contacts to said address book or pull them from there.

Is there some log on the phone that reports on these sync attempts?

It seems to me that my expectation of CardDAV was wrong, basically the nextcloud address book(s) act as additional address books on the phone just like they are additional Calendars, so what is on the phone stays on the phone while what is on Nextcloud or created on the phone set to Nextcloud will sync there.

I’m now digging through contacts.db to see if I can modify it to quickly have all my contacts migrated to Nextcloud.

I think my mistaken perception came from a time that I setup a google account and forgot to make it sync one way and e-mail only and thus violated the privacy of the part of my address book that got uploaded, which does suggest that this could be possible for Nextcloud too.

Lastly from my initial inspection of contacts.db it looks like by not specifying a single address book for the phone to use items will get duplicated since Nextcloud shares some automated address books like “Recently Contacted”, thus it may be wise to adjust the Advanced settings and point the phone only at a specific Address book or (if a Jolla dev is here) maybe add an interface similar to the Calendars where you chose which of the address books should sync.

1 Like

Initial very promising find:

I modified one contact in the database in a very minor way and it appeared on Nextcloud after reboot + sync (I reboot to make sure the changed db is active).

Every contact has (at least) 2 entries in contacts.db one defining where it is stored and one “aggregate”, both are different “collections”, by only changing the collectionId in the Contacts table to refer to Nextcloud instead of local storage it was “moved” and after a sync happened it indeed appeared on Nextcloud.

I ran the following query:

update Contacts set collectionId = 36 where collectionId = 2;

By me 36 is a Nextcloud address book and 2 local storage.

It seems to have mostly worked, though I still need to do some sampling of contacts to make sure information wasn’t lost (I have a backup of contacts.db of course).


The saga continues, the above method does not generate entries in the syncTarget table thus contact get duplicated every time a sync runs on the nextcloud side.

That sounds like a bug in the sync code… If an entire table is missing, sync should either not work and error out, or create the table and continue then…

It requires quite a lot of manual database work to iccur, but still.

I tentatively agree though not for the reason you think, the table is not missing but rather no entries are generated for all the contacts, so the contacts that I created on Nextcloud as a test or on my phone in the Nextcloud address book all have this, I’m not 100% but I think even the single contact that I changed at the beginning to to test if the method would be viable has it.

If the last sentence is true then the bug happens when more than a single contact get synced to Nextcloud (and as far as I recall way back when I tried to have this with different groupware also other carddav).

I’ll be resetting my contacts.db and Nextcloud contacts to test my hypothesis.

1 Like

I misread your post, sorry about that. Yes, the table is empty, not completely missing.

Let’s see what you end up with. I just realized that I have a spare SFOS device and a self-hosted Nextcloud, so I can easily poke around and test your findings too!

I have so far done a test with a single contact and 2 contacts, both cases resulted in syncTargets entries.

11 Contacts also worked.

So far I have only tried non-aggregate contacts, I also have some aggregates maybe the issue is there.