Alternatives of Local Folders to OneDrive Syncing

 

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…

MKLINK

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:

MKDIR %USERPROFILE%\SkyDrive\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.

MOVE…

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:

  1. You can define the SkyDrive folder as a ‘standard’ one with the “Set as default save location” option
  2. 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!)
  3. 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

sleep 10

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?

Advertisements

4 thoughts on “Alternatives of Local Folders to OneDrive Syncing

  1. Thanks for your post. When trying to use the Windows GUI location method (for example with the Documents folder), I just click on the MOVE but I just get copy of that folder in the to the cloud synced folder (not the folder moved or linked to). Any advise?
    I’ve also used the MKLINK option but that didn’t work, as Onedrive just creates a subfolder under the cloud folder.
    Thanks!

    1. Hi Biel.
      Can you please substantiate what is meant with ‘(not the folder moved or linked to)’?
      On my PC, using the GUI/Location method, I move the Documents folder to a new location under the synced cloud drive folder without problems. After that it is still presented through Windows Explorer as “My Documents” under the Documents library but firstly you see a synced folder icon and secondly if you click on it the path is the new one. If you navigate directly to %USERPROFILE%\Documents the folder still exists but should be empty. To avoid confusion you can rename it to Documents.old
      PS: on second reading (regarding MKLINK) you cannot put the CONTENTS of a folder directly under the synced folder. E.g. you should still create a subfolder, like %USERPROFILE%\OneDrive\Documents.

      1. Hi
        Thanks, for your reply. In my case when moving the Documents folder I don’t know why I just get a copy of the folder, i.e. it is not only the name of the folder (with no content) and neither is an image of the folder.
        I’ll try again the MKLINK, but I feel I’ll move to SugarSync, where I can just select any folder anywhere in my units, and forget about OneDrive.
        thanks!

        Biel

      2. Hi Biel, very strange behavior indeed. I don’t think this has something to do with OneDrive directly.
        Still thanks for the information about SugarSync.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s