Diff for "SyncEvolution/synchronize-multiple-google-calendars-with-evolution-calendars"


Differences between revisions 5 and 6
Revision 5 as of 2013-06-01 11:13:38
Size: 6481
Editor: localhost
Comment:
Revision 6 as of 2013-06-05 16:43:26
Size: 7647
Editor: localhost
Comment:
Deletions are marked like this. Additions are marked like this.
Line 169: Line 169:

=== List all databases: ===
{{{
syncevolution --print-databases
}}}

=== List all sessions under a peer: ===
{{{
syncevolution --print-sessions --quiet gcal
}}}

=== Show information about configuration(s): ===
{{{
syncevolution --print-servers|--print-configs|--print-peers
}}}

{i} either use '''--print-servers''' OR '''--print-configs''' OR '''--print-peers'''

=== Show information about a specific configuration: ===
{{{
syncevolution --print-config --quiet gcal workcal
}}}

=== List local calendar items: ===
{{{
syncevolution --print-items gcal workcal
}}}

=== List remote calendar items: ===
{{{
syncevolution --print-items target-config@gcal workcal
}}}

=== Prints what changes were made locally since the last synchronization: ===
{{{
syncevolution --status gcal workcal
}}}

=== Remove a config/peer: ===
{{{
syncevolution --remove gcal
}}}

=== Create, update or remove a configuration: ===
{{{
syncevolution --configure <options> [--] <config> [<source> ...]
}}}

To view all command-line options go to [[https://syncevolution.org/documentation/syncevolution-usage |syncevolution-usage]] wiki page.

Introduction

We are going to synchronize google-calendars(Personal, Work) with evolution calendars (Personal, Work) respectively.For shake of simplicity we took similar name for these calendars.

These following commands are documented assuming one is using the latest version of syncevolution (syncevolution >=1.32)

Sync Scenario

Google Calendar

Evolution Calendar

Source

Database

Peer

Work

Work

workcal

Work

gcal

Personal

Personal

personalcal

Personal

(i) One can choose any arbitrary peer name.


Setup

Synchronization between work calendars is shown here

1. Create a Peer for Google calendar (gcal)

syncevolution --configure --template Google_Calendar username=YOURUSERNAME@gmail.com password=**** target-config@gcal

(i) Here Google_Calendar template is used. One can also use webdav template. To list the known configuration templates run following commands at terminal-prompt:

syncevolution --template ?

2. Create a new source for work calendar

syncevolution --configure backend=evolution-calendar database=Work @default workcal

3. Add a remote database to the source (workcal)

syncevolution --configure database=https://www.google.com:443/calendar/dav/GOOGLRCALENDARID@group.calendar.google.com/events/ backend=caldav target-config@gcal workcal

Replace GOOGLECALENDARID with your own google-calendar id for work calendar. To find the required calendar-id go to google-calendar. Hover mouse over respective calendar, click down arrow & select settings.Then copy the calendar id as shown in the following image:

http://i.imgur.com/urehOZB.png

http://i.imgur.com/RSjnAZ4.png

4. Connect remote calendars with local databases (sync-config)

syncevolution --configure --template SyncEvolution_Client syncURL=local://@gcal username= password= gcal workcal

5. Add a local database to the source (workcal)

syncevolution --configure sync=two-way database=Work gcal workcal 

To list all local databases run following command at terminal-prompt:

syncevolution --print-databases

6. Check whether configured properly (Optional)

To check whether all configuration is working properly one can print all items in local or remote databse.

To print all items(calendar events) in local database run:

syncevolution --print-items gcal workcal 

To print all items(calendar events) in remote database run:

syncevolution --print-items target-config@gcal workcal

7. Start syncing (First-Time)

syncevolution --sync refresh-from-client gcal workcal 

(i) For the first-time sync it is strongly recommended to use -- sync refresh-from-client or --sync slow option during the sync to avoid duplicity.

(X) Caution: "refresh-from-client" option WILL DELETE EVERYTHING IN EVOLUTION CALENDAR (for caldav/carddav client is remote server & server is local client i.e. syncevolution) AND REPLACE WITH GOOGLE-CALENDAR.

To find all possible sync-option run following command at terminal-prompt:

syncevolution --sync ?

General sync-options are explained below:

Sync Option

Meaning

two-way

Normal two-way sync

slow

Exchange all data. Recommended for first time sync to avoid duplicity

refresh-from-client

Deletes everything on server & replaces with client (opposite for caldav/carddav)

refresh-from-server

Deletes everything on client & replaces with server (opposite for caldav/carddav)

8. Start Normal Sync (After first sync)

syncevolution gcal workcal

This will start two-way sync which is the default sync-option defined in step 5.

For other calendars repeat steps 2,3,4,5,6 & 7 with separate data-source & calendar-id for each calendar.Multiple data-sources can be synced at the same time:

syncevolution gcal workcal personalcal

To sync all sources under a peer run:

syncevolution gcal

http://i.imgur.com/dLJJUew.png


Restore from backup

One can go back to original state if anything goes wrong during the sync. SyncEvolution automatically creates backup for each sync-session & saves as logdir(log directory) to '~/.cache/syncevolution.

To list all sessions for the peer gcal run following command at terminal-prompt:

syncevolution --print-sessions --quiet gcal

The output would be something like this:

/home/$USERNAME/.cache/syncevolution/gcal-2013-01-31-19-56
/home/$USERNAME/.cache/syncevolution/gcal-2013-05-16-20-57
/home/$USERNAME/.cache/syncevolution/gcal-2013-05-16-21-50
/home/$USERNAME/.cache/syncevolution/gcal-2013-05-16-21-52
/home/$USERNAME/.cache/syncevolution/gcal-2013-05-22-12-59
/home/$USERNAME/.cache/syncevolution/gcal-2013-05-26-14-05
/home/$USERNAME/.cache/syncevolution/gcal-2013-05-28-14-30
/home/$USERNAME/.cache/syncevolution/gcal-2013-05-29-23-08
/home/$USERNAME/.cache/syncevolution/gcal-2013-05-29-23-47
/home/$USERNAME/.cache/syncevolution/gcal-2013-05-30-19-45

What we need here is the session directory path which is /home/$USERNAME/.cache/syncevolution/gcal-2013-05-30-19-45 (last sync session) from the above example. On can restore either after or before the sync for each sync-session except the last.

The default restore command with all parameters looks like this:

syncevolution --restore <session directory> --before|--after [--dry-run] [--] <config> <source> 

(i) Remove --dry-run option option to write data to evolution-data-server. However it is recommended to pass --dry-run option (before running without it) to view all calendar events that are going to be restored.

For example, to restore workcal before last sync-session run:

syncevolution --restore /home/$USERNAME/.cache/syncevolution/gcal-2013-05-30-19-45 --before gcal workcal

To restore all sources under gcal run:

syncevolution --restore /home/$USERNAME/.cache/syncevolution/gcal-2013-05-30-19-45 --before gcal


Other Command-Line Usage

List all databases:

syncevolution --print-databases

List all sessions under a peer:

syncevolution --print-sessions --quiet gcal

Show information about configuration(s):

syncevolution --print-servers|--print-configs|--print-peers

(i) either use --print-servers OR --print-configs OR --print-peers

Show information about a specific configuration:

syncevolution --print-config --quiet gcal workcal

List local calendar items:

syncevolution --print-items gcal workcal

List remote calendar items:

syncevolution --print-items target-config@gcal workcal

Prints what changes were made locally since the last synchronization:

syncevolution --status gcal workcal

Remove a config/peer:

syncevolution --remove gcal

Create, update or remove a configuration:

syncevolution --configure <options> [--] <config> [<source> ...]

To view all command-line options go to syncevolution-usage wiki page.

SyncEvolution/synchronize-multiple-google-calendars-with-evolution-calendars (last edited 2014-11-13 11:06:05 by 117)