Synchronize SOGo - SyncEvolution - Evolution

From WickyWiki
Revision as of 12:39, 17 August 2014 by Wilbert (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Sources

It is hard to find answers on the web. The best help i could find (with examples) can be found in the manual:

man syncevolution

Websites:

Install Evolution

sudo apt-get install evolution

Installation of latest SyncEvolution

sudo gedit /etc/apt/sources.list

Add these lines and save:

#20130701 wjv SyncEvolution
deb http://downloads.syncevolution.org/apt stable main
sudo apt-get update
sudo apt-get install syncevolution-evolution

SyncEvolution installation from repository

SyncEvolution:

sudo apt-get install syncevolution

GUI, only useful for SyncML configuration:

sudo apt-get install sync-ui

Configuration

Remove

Not responding? Then you could kill the dbus server:

killall syncevo-dbus-server

The name of the SyncEvolution configuration in this guide is 'sogo'. Run the commands as the Linux user that will be using Evolution and the configuration will be stored under that user.

Remove previous configurations (you will see an error if it doesn't exist):

syncevolution --remove target-config@sogo
syncevolution --remove sogo

About the password

The password will be stored in the keyring. To change it you can also change it there. It is possible to save the password in the configuration files, however, this would make it more difficult to keep your password safe.

Note: your own passwords in the keyring are accessible when you are logged in, Menu -> Passwords and Keys.

These are the full example SOGo urls for a SOGo user:

Evolution calendar

Configure the Evolution endpoint. This endpoint is referred to as 'local'.

  • Username and password are left blank.
syncevolution --configure --template SyncEvolution_Client sync=none syncURL=local://@sogo username= password= sogo

The SyncEvolution_Client has four standard entries:

  • addressbook
  • calendar
  • memo
  • todo

SOGo server

Configure the SOGo endpoint. This endpoint is referred to as the 'target-config' and/or 'remote'.

  • Replace username and password with your own
  • You can ignore '[INFO] .. backend failed ..' messages
  • The option 'SSLVerifyServer=0' is to ignore certificate verification warning to allow self-signed certificates
#profile, you will get a number of [INFO] messages
syncevolution --configure SSLVerifyServer=0 --template webdav username='**SOGo-userlogin**' password='**SOGo-pwd**' syncURL=https://wilbertvolkers.linkpc.net target-config@sogo
syncevolution --print-configs


Configure the database and backend for calendar and addressbook:

syncevolution --configure database=https://wilbertvolkers.linkpc.net/SOGo/dav/wilbert/Calendar/personal/ backend=caldav target-config@sogo calendar
syncevolution --configure database=https://wilbertvolkers.linkpc.net/SOGo/dav/wilbert/Contacts/personal/ backend=carddav target-config@sogo addressbook

Other settings:

#disable the automatic backup of database content
syncevolution --configure printChanges=0 target-config@sogo
syncevolution --configure dumpData=0 target-config@sogo

Test

Note: the manual states that if you used "-" as 'password' you can enter your password now and it will be stored in the keyring. There will be no password prompt if it has already been stored in the keyring. Unfortunately this didn't work for me, the proces would hang after requesting the password. Instead provided the password on the commandline as described in this manual.

List items SOGo / remote / target-config:

syncevolution --print-items target-config@sogo calendar
syncevolution --print-items target-config@sogo addressbook

List items Evolution / local:

syncevolution --print-items sogo calendar
syncevolution --print-items sogo addressbook

Enable/activate and configure sources

Here 'one-way-from-remote' means from SOGo (remote) to Evolution. Note that if you mix this up you could end up with an empty SOGo addressbook and calendar. Suffice to say that now would be a good moment to backup your SOGo and/or Evolution data at this point.

syncevolution --configure --source-property sync=one-way-from-remote sogo calendar
syncevolution --configure --source-property sync=one-way-from-remote sogo addressbook

Sync

First time slow sync, replace local data (Evolution)

Backup your SOGo and/or Evolution data!

You have to do 'calendar' and 'addressbook' separate or you could get an error:

syncevolution --sync refresh-from-remote sogo calendar
syncevolution --sync refresh-from-remote sogo addressbook

Sync 'sogo' as configured

syncevolution sogo

Crontab schedule

Note: the crontab solution didn't work very well for me because of access to the keyring password. I used a script to sync at logon instead.

sudo gedit /etc/crontab

Possible crontab entry: user=wilbert, every 60mins:

10 * * * * wilbert /home/wilbert/Scripts/wjv-cron-syncevolution.sh

For other crontab examples see MySQL#Schedule_a_backup_with_crontab.

Create script:

gedit /home/wilbert/Scripts/wjv-cron-syncevolution.sh
#!/bin/bash
sessionfile=`find "${HOME}/.dbus/session-bus/" -type f`
export `grep "DBUS_SESSION_BUS_ADDRESS" "${sessionfile}" | sed '/^#/d'`
syncevolution  sogo

Deny others access and make executable:

chmod 700 /home/wilbert/Scripts/wjv-cron-syncevolution.sh

Note: I had a DBUS problem running the job from crontab with su. Likely because syncEvolution gets the user credentials from keyring via DBUS. That's why we set 'DBUS_SESSION_BUS_ADDRESS'. For more info see:

Complete removal

sudo apt-get autoremove --purge syncevolution
sudo apt-get autoremove --purge sync-ui
sudo apt-get autoremove --purge syncevolution-evolution

Configuration files are placed in /home/$USER/.config/syncevolution/

Go to Menu -> Passwords and Keys to remove passwords in the keyring.