Detailed OpenSync Installation/Usage Example
You might want to have a look at SetupGuide-0.30 if you are using OpenSync 0.3x.
Initial installation
First, download and install: OpenSync, the plugins you plan to use, and Multisync.
Check if everything is installed
Check if the plugins were installed correctly. You should get something like this :
$ msynctool --listplugins Available plugins: file-sync kdepim evo2-sync $
Test file-file synchronization
You can now test if snchronisation between two directories containing files work.
Create the group
$ msynctool --addgroup filefile $
Add the file-sync members
$ msynctool --addmember filefile file-sync $ msynctool --addmember filefile file-sync
The result should be:
$ msynctool --showgroup filefile
Groupname: filefile
Member 1: file-sync
No Configuration found: Member has not been configured
Member 2: file-sync
No Configuration found: Member has not been configured
$
Create the directories
In this example, we will use the directories sync1 and sync2 on the home directory. We will consider that the home directory is /home/joeuser. Please replace with the proper names.
$ mkdir ~/sync1 $ mkdir ~/sync2 $
Configure the members
Configuring the first member :
$ msynctool --configure filefile 1
This should open the vi text editor, where you can enter the configuration data for the member.
After opening the text editor, you should see a xml-file like this:
<?xml version="1.0"?>
<config>
<directory>
<path></path>
<objtype>data</objtype>
</directory>
[...]
</config>
(There are other sections which we left out here to keep it shorter)
now enter the directory path for the first member to that the config looks like this (with your username, of course):
<?xml version="1.0"?>
<config>
<directory>
<path>/home/joeuser/sync1</path>
<objtype>data</objtype>
</directory>
[...]
</config>
Also, uncomment the <directory> sections for objtype contact and event and define your paths. For this simple example, you may take the same path for every objtype. In real life, you would maybe have /home/joeuser/sync1/contacts and /home/joeuser/sync1/events or whatever.
Follow the same steps for the second member:
$ msynctool --configure filefile 2
Discover
Next step is to discover the synchronizable object types. This is done with
$ msynctool --discover filefile
member:0
Discovered Objtypes:
data
Format: file
contact
Format: vcard30
event
Format: vevent20
member:1
Discovered Objtypes:
data
Format: file
contact
Format: vcard30
event
Format: vevent20
$
If it does not show the contact and event lines, you did not define the paths for those sections or you forgot to uncomment them. Return to the step above.
First test: empty directories
$ msynctool --sync filefile Synchronizing group "filefile" Member 2 of type file-sync just connected Member 1 of type file-sync just connected All clients connected or error Member 2 of type file-sync just sent all changes Member 1 of type file-sync just sent all changes All clients sent changes or error Member 1 of type file-sync committed all changes. Member 2 of type file-sync committed all changes. All clients have written Member 1 of type file-sync just disconnected Member 2 of type file-sync just disconnected All clients have disconnected The sync was successful $
Second test: Add a sample vcard to the directory
Create a simple vcard file on ~/sync1. You can use you favorite PIM application to export some contacts to the vcard format.
To create a simple vcard file, copy the following contents to the file ~/sync1/vcard1.vcf using any editor:
BEGIN:VCARD VERSION:3.0 N:Test User END:VCARD
Synchronize:
$ msynctool --sync filefile Synchronizing group "filefile" Member 1 of type file-sync just connected Member 2 of type file-sync just connected All clients connected or error Member 2 of type file-sync just sent all changes Received a entry vcard1.vcf with data of size 24 from member 1. Changetype ADDED Member 1 of type file-sync just sent all changes All clients sent changes or error All conflicts have been reported Member 1 of type file-sync committed all changes. Sent a entry vcard1.vcf of size 24 to member 2. Changetype ADDED Member 2 of type file-sync committed all changes. All clients have written Member 1 of type file-sync just disconnected Member 2 of type file-sync just disconnected All clients have disconnected The sync was successful $
The result should be:
$ ls ~/sync1 vcard1.vcf $ ls ~/sync2 vcard1.vcf $
It worked!
KDE-file synchronization
Create the group and members
$ msynctool --addgroup kdefile $ msynctool --addmember kdefile kdepim-sync $ msynctool --addmember kdefile file-sync $
Configure the members
See the session about member configuration above, on the file-file synchronization for more details.
The kdepim member don't need configuration. Just configure the second member (the file-sync member):
$ msynctool --configure kdefile 2
And on the configuration data opened on the editor, the directory name:
<?xml version="1.0"?> <config> <!-- directory path for file-sync --> <path>/home/joeuser/sync1</path> <!-- should care of subdirectories (TRUE or FALSE) --> <recursive>FALSE</recursive> </config>
Note: the directory specified here should exist before running the synchronization.
Synchronize
First, add some contacts to kaddressbook and some events on korganizer. You may want to use Kontact, that is a integrate PIM suite, to make things easier and open both kaddressbook and korganizer on the same application.
Then start the synchronization. (Kontact and kaddressbook/korganizer need to be quit before sync!!)
Example:
$ msynctool --sync kdefile Synchronizing group "kdefile" Member 2 of type file-sync just connected call failed Member 1 of type kdepim just connected Received a entry goufLxPhNp with data of size 190 from member 1. Changetype 1 <?xml version="1.0"?> <note><Summary><Content></Content></Summary><Body><Content></Content></Body></note> Received a entry toFOxhmYAO with data of size 244 from member 1. Changetype 1 Member 2 of type file-sync just sent all changes Received a entry libkcal-311607955.636 with data of size 54 from member 1. Changetype 1 Member 1 of type kdepim just sent all changes All clients sent changes or error Sent a entry goufLxPhNp of size 4 to member 2. Changetype 1 Sent a entry toFOxhmYAO of size 4 to member 2. Changetype 1 Sent a entry libkcal-311607955.636 of size 4 to member 2. Changetype 1 Member 2 of type file-sync just disconnected Member 1 of type kdepim just disconnected All clients have disconnected The sync was successfull $ ls ~/sync1 goufLxPhNp libkcal-311607955.636 toFOxhmYAO $
Evolution 2 - file synchronization
There is a Evolution 2.0 - file synchronization page for information on synchronization between Evolution2 and file-sync.
