Hi Patrick,

thanks for your reply.

On Sun, May 20, 2012 at 09:03:30PM +0200, Patrick Ohly wrote:
> On Sat, 2012-05-19 at 20:44 +0200, Tom Kazimiers wrote:
> > Hi all,
> > 
> > I try to have two different databases in sync: abook [1] and a SyncML
> > server. Abook is a small address book program that integrates well with
> > the mail client mutt. It is able to export and import its data in
> > various formats, amongst them VCard. Since syncevolution is able to
> > handle this, it seems to be the perfect tool for the job. Using abook's
> > VCard export/import functionality, it will create/read one VCard file
> > for its whole data base. This can be split into single files for the
> > use with syncevolution.
> >
> > I hope the actual syncing will work like this: export current abook
> > data to VCard, split it into one file per item, use this as the file
> > backend data for syncevolution, sync, combine single updated VCard files
> > into single files and import them back into abook.
> 
> Do you aim for two-way synchronization? In that case you'll have to be
> more careful when exporting from abook (don't rewrite files
> unnecessarily, to avoid turning every sync into a "refresh from abook")
> and when importing into abook (don't overwrite data which is more
> recent; can be done by always syncing abook->file->SyncML->file->abook,
> as you said).

Yes, I aim for two-way synchronization. This, indeed, needs to be
handled with caution. Thanks for the hints on that.

> > However, after a lot of reading and fiddling with syncevolution I
> > couldn't manage to get it to work. I would appreciate it very much if
> > you could show me the right direction. This is what I did:
> > 
> > I added a peer (I think) for the SyncML server which seems to
> > synchronize fine, called funambol@default. Then I added another
> > context (that's what I think it is) for the local VCard file backend:
> > 
> >     syncevolution --configure backend=file \
> >         database=/home/tom/tmp/sync/vcard-dir \
> >         databaseformat=text/vcard @local addressbook
> > 
> > Based on this I created another peer, local@default:
> > 
> >     syncevolution --configure syncURL=local://@local \
> >         peerIsClient=1 sync=two-way local addressbook
> 
> What you seem to be trying here is the configuration of a local sync
> config between @default addressbook(= usually EDS) and @local
> addressbook (= file). This should work, but is unnecessarily complex -
> see below for a simpler way.

Okay, good to know. I am still in the process of finding out how
everything ties together. But more and more things start to make sense.
I now use the simpler way suggested by you.

> > Now it seems I can update my local VCard data with the help of these
> > two commands:
> > 
> >     syncevolution funambol@default
> >     syncevolution local@default
> >  
> > With this I am able to update the VCard folder (here:
> > /home/tom/tmp/sync/vcard-dir). But I don't seem to be able to get changes
> > from the VCard files back to the SyncML server. All the changes I make to
> > the VCard files are not recognized by syncevolution (I try to sync with
> > the last two commands as well).
> 
> What changes do you make to the vCard files? It should be possible to
> modify them (which must touch the last modified time stamp), add new
> files (file name doesn't matter) and delete some.

It now works using the approach you suggested. I might had something
configured wrongly with my previous setup. However, it seems
syncevolution has a problem with different entries having the same
content. What happens is: a first synchronisation works without
problems and also --status calls show no changes. But after I change a
file and sync it I get new output from --status and sync calls:

        Data modified locally during synchronization:
        *** addressbook ***
                                                           before sync | after 
sync
                                           removed during sync <
                                                                                
   > added during sync
        
-------------------------------------------------------------------------------
                                                                                
   > …
                                                                                
   > …
        …
        
-------------------------------------------------------------------------------

Every duplicate entry is listed there as locally modified during sync. I
did not change anything on those files, though. After having removed all
duplicates, it works without problems. I just was wondering about this
behaviour.

> It will be easier to test this when syncing Funambol directly against
> your @local file source:
>    syncevolution --configure \
>                  --template funambol \
>                  funambol@local \
>                  addressbook
> 
> Strictly speaking, the "--template" parameter is redundant because
> SyncEvolution would guess the right template based on the config name.
> 
> Now you can synchronize with "syncevolution funambol@local" and check
> for changes with "syncevolution --status funambol@local". The latter
> command will tell you which changes in the file address book
> SyncEvolution sees, without changing anything.

Thanks a lot! This makes the configuration much easier. So this
configuration adds a new peer (funambol) to the context "@local",
doesn't it? And because the @local context has a file backend the peer's
data gets stored in vCards?

> > Based on this I have two questions:
> > 
> > 1. Does my approach make sense at all?
> > 2. Why isn't my modified VCard data synced back?
> 
> It should be possible to do this, either as you planned or directly. I'm
> not sure yet why it fails.

It might have been due to some misconfiguration here. The
synchronisation does work now with your config.

Next I will look into getting this to work with abook.

Cheers,
Tom

Attachment: pgpvblMpkJkqS.pgp
Description: PGP signature

_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution

Reply via email to