Moving to CardDAV

It’s time to unify my various phone/email contact lists into a single contact database. CardDAV seems perfect for the job and I already run a DAViCal server that supports both CalDAV and CardDAV.

History

My email addressbook is currently very disjoint and is primarily based around the builtin address book in Mozilla Thunderbird. However I use Thunderbird on a couple of different devices and each is disjoint and contains an incomplete version of my contacts. Mobile devices have been used for reading mail only (a pain to type anything more than a one line message) and hence do not really have much in the way of contacts recorded.

Phone contacts are a bit more organised. Part of this stems from the fact that I tend to use only one smartphone at once and this makes managing numbers a bit easier. In line with my general distrust of technology (it always breaks at the most inopportune moment) I have used SyncML/Funambol to maintain a backup of the contacts database.

Going Forward

CardDAV is widely supported in many devices and seems like an ideal technology to consolidate my address books.

  • iPhone – supports CardDAV natively. Just add a new CardDAV contacts account under “Settings” -> “Mail, Contacts, Calendars” -> “Other”.
  • Android – requires the “CardDAV-Sync beta” or “CardDAV-Sync free beta” connector. Once installed add a new “CardDAV” account on the “Settings” screen.
  • Thunderbird – requires the “Inverse SOGo Connector

DAViCal provides a CardDAV server to act as the master store for the address books on each device.

The first action is to create a contacts collection in the relevant user’s configuration screen

DAViCal collections list

DAViCal collections list

Ensure that the collection is created as an Addressbook rather than a Calendar.

DAViCal Contacts Setup

DAViCal Contacts Setup

Migrating from SyncML

In order to import my phone Address Book into CardDAV I did a two-step shuffle. First I imported the contacts from MyFunambol (a SyncML service) into the Thunderbird Address Book using evolutionsync.

Warning this synchronisation could destroy any existing Thunderbird/Evolution Address Book so use with care.

First configure evolutionsync using

syncevolution --configure  https://my.funambol.com/sync  username oldelvet  password=-

Then perform a one off synchronisation using

syncevolution --run funambol

At this stage the Mozilla Thunderbird “Personal” Address Book will contain a copy of the phone Address Book.

More details on syncevolution usage.

Now ensure that the DAViCal contacts account has been added to the Thunderbird Address Book. Add a new “Remote Address Book”

Add new CalDAV account using SOGo Connector

Add new CalDAV account using SOGo Connector

Enter the appropriate configuration details for your DAViCal/CardDAV server.

SOGo Connector Properties

SOGo Connector Properties

Now addresses can be drag-and-dropped from the Personal Address Book into the CardDAV Address Book.

Tidying Up

Entries from individual Thunderbird instances can be transferred into the CardDAV Address Book in a similar way. Do remember to ensure that the Thunderbird copy is regularly synchronised with the DAViCal server.

Thunderbird Address Book Synchronisation

Thunderbird Address Book Synchronisation

Without the synchronisation the Address Books can get in a mess and any edits to individual entries may get lost if the same entry is changed in another client.

Once the first pass transfer is completed the entries from each source Address Book need to be edited/merged to ensure that the CardDAV Address Book holds a master copy of the contacts database.

Keeping Things Safe

In order to provide an audit trail/fallback backup system I am exporting the CardDAV database into a file which is then tracked in a git repository.

The export is performed using python project carddav-util script. The backup is performed using

./carddav-util.py --download --user=richm --url=https://calendar.my.domain/caldav.php/richm/contacts --file=richm.vcf

As well as providing a backup of the database this also allows changes to be inspected in detail.