Is there a 'correct' sequence to start sync between 2 computers?

After a day installing and trying the software (0.11.8 on Ubuntu 1404 desktop and 0.11.8 on laptop Debian Jessie), I wanted to try syncing the Inbox and Sent boxes from the mail client between my desktop and an old portable.

The sync seemed to work but at first check, it looked like the sync had been in the wrong direction - the portables files were a day older than the desktops but the desktop ended up with the old copy from the laptop. I had tried, after creating the new folder, to start the desktop syncthing first.

I used a backup copy to put the desktop back to the latest versions but later in the day, I saw 4 emails coming in but they were not visible in the Inbox. Investigation showed that I now had 2 Inboxes and 2 Sent boxes (two carrying syncthings conflict labels).

Later still, I read another thread on this forum which mentioned that syncthing spawns a new process when it does a restart. Since I did some restarts when setting up the new folder on both machines, I must have had several instances of syncthing running even though I thought I had stopped it. Could that have set the sync exchange going wrong direction ?

Before trying again, I though it would be good to see if there are any preferred procedures for starting up a new sync folder.

I believe this is a pain point for the moment. Either

  • Sync both folders manually (e.g. using rsync) before launching Syncthing for the first time (or after resetting the index).
  • Keep one of the folders empty such that all files will be pulled.

Improvements for the behavior your observed are discussed in https://github.com/syncthing/syncthing/issues/1848

Syncing is fundamentally based on file “generations”, i.e. how many times a file has changed since we first saw it. When doing the initial sync and having files with differing contents you have two files both of generation 1, but differing. That’s a sync conflict, and one of them will be chosen to be correct. Which one is currently based on the device ID, not the initial time stamp.

Say I get both files in sync, A on the desktop and B on the laptop, then I make a couple of changes to A and one change to B. Does this mean that A will be synced to B and the 1 change in B will be lost ?

No, that means you have a sync conflict, which will be resolved to one of the files and the other gets stashed as originalfilename-sync-conflict-$date-$time.ext.

OK… that means, I think, that I’ll have to be careful to ensure that sync takes place after any modifications to A and before any possible change to B. And vice versa. Otherwise, there is pain and grief with having to do a manual sort of conflicted files.

In the case of syncing mailboxes, it will mean never risking having the mail client open on each machine at the same time.

I’ll give that a try again in a day or so and see if it is easily manageable.