How does Dropbox determine when to overwrite the local file vs overwrite the cloud file

dropboxsync

When Dropbox encounters a file on one's computer that is different than the cloud version of that file that it knows about, how does it decide whether it should sync them by overwriting the local file with the cloud file or sync them by overwriting the cloud file with the local file?

To rephrase:

  • If the server copy and the local copy of a file are different,

  • and if the dropbox program is launched and finishes syncing,

  • then these two files will be the same.

These two files will also be identical to one of the old files. My question is which — the old server copy or the old local copy? How does it decide?

Best Answer

I don't know the technicalities of this, but I do have the situation where I and my assistant operate a common dropbox with two different computers going on and off at different times.

The answer to your question is that when you connect with the Cloud, Dropbox knows (somehow) that the version currently on the Cloud was originally synced from your computer. So if your computer version is different, that is the version that will be synced to the Cloud.

If two computers (say A and B) are using the same dropbox, and each make changes offline, then the first computer powers up (let's say it is computer A) will generate a sync of its update to the cloud. So now there will be same version (containing the A update) on A and Cloud.

When computer B is powered up, Dropbox will realise that computer B's version of the file is not only different from the current cloud version (which is normal) but different from the last time Dropbox synced from it. So if it were to sync B's file to the A version, B's changes would be lost. So what Dropbox does is make a copy of the B version and add "B's conflicted file" to the file name. B's original file is then synced to the A updates. The conflicted file, containing the B updates, is then synced to the cloud and back down to A.

Deletions, and conflicts arising from selective sync, are handled in a similar way

A conflict also arises if one of the computers does not close the file before powering down. Syncing does not occur on an open file, so in this case B's updates will be the ones that are synced, and A's open file will end up as a conflict. This can be a huge pain to harmonize, but this is our fault, not Dropbox's.

Hope this helps.

Related Question