Sync
This page explains and suggests various ways of synchronizing contacts, calendars and files.
Calendar, Notes, Tasks and Contacts
Synchronizing calendar, notes and tasks (using CalDav) and contacts (using CardDav) can be done using syncevolution (other backends are available, but not currently documented here). A frontend to running synchronization tasks is available in the repository (Syncevolution Frontend).
GUI
Synchronizing with syncevolution CalDav + CardDav
If you get stuck in an odd state setting this up, you could consider running the following to get to a clean state, at least with regards to syncevolution configuration:
rm -rf /home/user/.config/syncevolution
NextCloud synchronizing
We will be synchronizing the calendar and such using local maemo-events, maemo-notes and maemo-tasks backends using the caldav backend. For contacts, we will synchronize evolution-contacts using carddav.
A few URLs are required, first, the main Nextcloud DAV url, this will appear like:
https://my.nextcloud.org/remote.php/dav
then there is the url for a specific calendar, this is called the "Private Link" and you can get it by clicking "Copy Private Link" for a given calendar in Nextcloud, this might look like so:
https://my.nextcloud.org/remote.php/dav/calendars/userhere/calendarnamehere/
Finally, for your address book (contacts) synchronization, the contacts URL is needed (in Nextcloud, go to contacts, settings, "Copy Link" for your contacts):
https://my.nextcloud.org/remote.php/dav/addressbooks/users/userhere/contacts/
Given the above, a setup to synchronize calendar, tasks, notes and contacts could look like this:
syncevolution --configure \ --template webdav \ username=NEXTCLOUD-USER-HERE \ password=NEXTCLOUD-PASS-HERE \ syncURL=MAIN-DAV-URL-HERE \ target-config@nextcloud syncevolution --configure \ --template webdav \ database=CALENDAR-URL-HERE \ backend=caldavtodo \ target-config@nextcloud nextcloudtodo syncevolution --configure \ --template webdav \ database=CALENDAR-URL-HERE \ backend=caldavjournal \ target-config@nextcloud nextcloudjournal syncevolution --configure \ --template webdav \ database=CALENDAR-URL-HERE \ backend=caldav \ target-config@nextcloud nextcloudcal syncevolution --configure \ --template webdav \ database=CONTACTS-URL-HERE \ backend=carddav \ target-config@nextcloud contacts syncevolution --configure \ --template SyncEvolution_Client \ sync=none \ syncURL=local://@nextcloud \ username= \ password= \ nextcloud syncevolution --configure \ sync=two-way \ backend=maemo-tasks \ database= \ nextcloud nextcloudtodo syncevolution --configure \ sync=two-way \ backend=maemo-notes\ database= \ nextcloud nextcloudjournal syncevolution --configure \ sync=two-way \ backend=maemo-events \ database= \ nextcloud nextcloudcal syncevolution --configure \ sync=two-way \ backend=evolution-contacts \ nextcloud contacts
All of the above is configuration that only needs to be done once.
Depending on your exact situation, your initial synchronisation could only use only values from your phone, from your nextcloud, or both. If you want to merge both, my understanding is that the slow method achieves this:
syncevolution --sync slow nextcloud nextcloudjournal syncevolution --sync slow nextcloud nextcloudtodo syncevolution --sync slow nextcloud nextcloudcal syncevolution --sync slow nextcloud contacts
Use the two-way synchronization method for normal synchronization (daily, hourly, etc synchronizations), like so:
syncevolution --sync two-way nextcloud nextcloudjournal syncevolution --sync two-way nextcloud nextcloudtodo syncevolution --sync two-way nextcloud nextcloudcal syncevolution --sync two-way nextcloud contacts
Warning: TLS Chain validation issues
If you run into problems with TLS Chain validation, first try to figure out if the problem is on your end. Syncevolution did have a problem for me validation the chain of my next cloud instance, so for testing purposes I set SSLVerifyServer = 0 in /home/user/.config/syncevolution/nextcloud/peers/target-config/config.ini
Radicale synchronising
Radicale is a simple CardDAV and CalDAV server, and is set up similarly to nextcloud. Just browse to the Radicale web URL, and use the following URLs:
- The main DAV url is simple the URL to your radicale server (without the .web part)
- The calendar URL is simply the http(s) URL to the calendar that you want to synchronize
- The contacts URL is simple the http(s) URL of the addressbook that you want to synchronize
The username (and optional password) are the radicale credentials.
Radicale Testing Server
For testing purposes, here is how to quickly run a radicale server, this assumed it's installed.
mkdir -p ~/radicale cd ~/radicale python3 -m radicale --config "" --storage-filesystem-folder `pwd` -H localhost:5223 --logging-level info
Now browse to http://localhost:5223, create an account (password is optional), and you should be able to synchronize, assuming the devices can reach your radicale server (don't have it listen on localhost only, perhaps use 0.0.0.0:5223 for LAN testing)
Files synchronization
TODO
Known Issues
- Synchronizing calendar to radicale gives errors if there are unnamed calendar events.
- Synchronizing contacts to radicale gives errors if there are contacts without Firstname or Lastname.