NOTE: the following methods apply to any cloud storage with sync client, OneDrive, SkyDrive, DropBox, Google Drive, etc. There is NO ‘best solution’! And no, you cannot use robocopy for this purpose; see why at the end of this page.
As soon as the cloud storage syncing was presented to the masses the question how to sync more than just the subfolders of the storage solution appeared. Quite obviously not everyone wanted to have SkyDrive\Documents and the standard Documents folders separately. Also simple syncing of settings scenarios – such as Favorites or Desktop – came to light…
If you search the web for a solution, 80% of all answers propose the MKLINK tool, so I present it here shortly: basically you create a subfolder under OneDrive or Dropbox, etc., you move all your data from the original folder and link the original to the new location. This link is transparent for the applications so most of the cases are solved.
An example to move Documents:
ROBOCOPY “%USERPROFILE%\Documents” “%USERPROFILE%\SkyDrive\Documents” /MOVE /ZB /XJ /COPYALL /DCOPY:T /EFSRAW /R:0 /W:0 /NFL /NDL /NS /NC /NP
MKLINK /J “%USERPROFILE%\Documents” “%USERPROFILE%\SkyDrive\Documents”
Please note that we use MKLINK /J(unction) instead of /D(irectory Symlink) option for very good reasons you can read about here.
Does Microsoft support this? No.
Do I recommend it? No. Generally because you are making three steps where something can go wrong and you are using command line tools like a *NIX guru. So let’s move to the second choice.
A different approach with very similar effect is using the Windows GUI. Here you combine the data migration with the folder redirection. In a nutshell there are six folders (Desktop, Documents, Favorites, Photos, Music, Videos) that have the ‘Path’ setting under their option.
From there you select Move… and redirect the folder to the cloud synced folder. This screenshot as well as a manual of how to sync your desktop can be found here. (Thanks for the extensive testing, Ian)
The advantages are that you don’t have to open the command line and that Windows makes everything for you. The disadvantage is that you cannot do that with a custom created folder, say ‘myBooks”. In such case you have the option to move the whole folder to the SkyDrive though, because there are no system dependencies on its path. If the folder was created from an app install, such as .freemind or .pdfsam, then you are left only with option MKLINK.
A third approach reverses the perspective and is the only one supported and recommended from Microsoft. If you have never heard of Libraries go search for it, or have a look at this 51 seconds video. Essentially what happens is that we still keep two (or more) folders – one under SkyDrive and one unsynced, but we put them logically together under the Documents library. What may first sound to you as a real cosmetic change is much more than that:
- You can define the SkyDrive folder as a ‘standard’ one with the “Set as default save location” option
- Furthermore you can separate cleary files of the same type (i.e. photos, videos) between the ones you really need to sync and the rest (think about the size of the videos!)
- Also very important is that the Windows Backup (and recently Files History) saves all folders under the libraries so you can have an additional backup (or even better: archiving with history) option
At the end I don’t think that there is only one winner in the game of choice. Actually I can imagine that you can combine two or even three of them after a considerable amount of contemplation.
PS: Aha, someone reminded me about ROBOCOPY as a sync tool itself and what can be done. Unfortunately not much… Forget it.
Briefly worded the tool is either a single usage or single way solution. There is no way that you can sync bidirectional in a persistently monitoring mode. What you can do is either sync once at logon and/or logoff with such a batch script:
start robocopy “%SOURCE%” “%DESTINATION%” /MIR /ZB /XJ
start robocopy “%DESTINATION%” “%SOURCE%” /E /ZB /XJ
or of course sync only one-way with this command line:
start robocopy “%SOURCE%” “%DESTINATION%” /MIR /ZB /XJ /MON:1 /MOT:5 /R:0 /W:0
but what will be the authoritative source in this case and what happens if you delete or modify a file from within the destination?