Sync Thunderbird Addressbook with Baikal using carddav

In my last article I described how to import Contacts from your Goggle Account. Now I will describe how to bring those (and also every other) contacts to baikal and how to setup synchronisation between Thunderbird and Baikal.

First of all we need to install the Sogo-Adapter Addon for Thunderbird (this provides DAV)

Sogo-Adapter
Sogo-Adapter

After that, we are able to create a Remote-Address Book in Thunderbird. Here you can see my settings for that address book.

The value „philipp“ is the ID of my Baikal-user, „default“ is the token-id of my address book in baikal (see related Baikal article).

Remote Address book
Remote Address book

Now you can move your contacts from your Google Addressbook to your Baikal Address book via drag&drop (or via copy&paste). After you have moved/copied the contacts to the baikal address book you should run the sync-command to push the contacts to your baikal-server (right-click on your baikal address book and hit „Synchronize“).

After that, the contacts should be available in your baikal database. Let’s to a simple check:

philipp@eliteX:~$ mysql -u baikalUser -p
Enter password: 
// removed some simple lines...

mysql> use baikal
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select count(*) from cards;
+----------+
| count(*) |
+----------+
|      323 |
+----------+
1 row in set (0.00 sec)

 

In my case, all of my 323 Google Contacts were stored in the database. Now I can sync every device and tool (Thunderbird, Android, etc.) with my baikal address book.

Related articles:

Baikal: Setup a user and addressbook

Open the web-admin-page of baikal: http://yourhost/<path_to_baikal>/admin/

In the admin-menu you can create a new user, in my case I created the user „Philipp“:

Create User
Create User

Now create a addressbook for that user:

Create Addressbook
Create Addressbook
Addressbook token id
Addressbook token id

 

That’s all. For synchronisation you need the card-dav URL:

// general
http://localhost/baikal/card.php/addressbooks/<user>/<addressbook_token_id>/

// in this case
http://localhost/baikal/card.php/addressbooks/philipp/default/

Related articles:

Installation of Baikal on Ubuntu

Before installing Baikal, we should ensure, that we will meet the requirements for Baikal:

  • an hosted webserver running apache 2 and PHP 5.3.0
  • PHP 5.3.1 or newer with the following extensions:
    • PDO and SQLite3 or MySQL
    • DOM (php-xml)

On Ubuntu you can install the following packages to meet the requirements:

sudo apt-get install mysql-server php5 php5-mysql

The Package php5-mysql contains the PDO libraries.

After you have installed the packages, you should setup a database and a database user for baikal. Login to mysql with root user to create the DB and the User:

mysql -u root -p


mysql> create database baikal;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| baikal             |
| database           |
| mysql              |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)


mysql> create user 'baikalUser'@'localhost' identified by  'baikalPassword';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on baikal.* to ‘baikalUser'@'localhost’;
Query OK, 0 rows affected (0.00 sec)

Now let’s check if the user has the necessary rights, by doing a login, open the database and do a select:

philipp@eliteX:/var/www/html/baikal$ mysql -u baikalUser -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.5.37-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| baikal             |
+--------------------+
2 rows in set (0.00 sec)

mysql> use baikal;
Database changed
mysql> show tables;
Empty set (0.00 sec)

After the database and user is ready, we can extract the package to our web-root/baikal. After you have extracted the package, open the location in a web browser:

http://<yourServer>/<path_to_baikal>

In the first step, you need to setup basic things like timezone, admin user, etc.

In the second step insert the necessary data for the database configuration (you do not need to insert the port number if you are using the default-port):

Baikal Installation
Baikal Installation

The Installation is done, you should now be able to login to baikal with your admin-user:

http://<yourServer>/<path_to_baikal>

 

Next steps: