nullstream weblog - Getting in sync with SyncToy

« Google Browser Sync | World Cup Homage »

Getting in sync with SyncToy


June 11, 2006 01:43 AM PST

Using the Google browser sync forced me to do a bunch of house cleaning on my bookmarks. The result of all that labor however is a very organized list that is in sync across all the computers I use. That little spring cleaning victory inspired me to go on and try to tackle an even bigger chore, one that I’ve been putting off for years: syncing all ‘My Documents’ between my laptop and my desktop.

I’ve been experimenting with a powerToy from Microsoft called SyncToy for about a month now, to sync some folders between machines. Nothing too heavy however, my pictures and some dev files. But I decided to go all out this weekend and turn it loose on the grand daddy of them all; ‘My Documents’. After a bit work and re-organizing I now have all my documents in sync and a strategy in place to keep them that way. Read on to see a very long entry on how I did it, and how you can too.

I’ve been accumulating files for years. I’ve got stuff in my documents folder going back to 1988. I also have had a lot of computers. Each time I build a new ‘main’ machine I copy all my documents over. Many times I use multiple machines concurrently and end up with different versions of files scattered all over the place. This really got out of hand when I bought my first laptop years back. What happened was that my documents kind of forked. I have some exclusively on my main desktop, some on my laptop, and some that overlapped. When I got my new laptop I copied the files from my old one and merged in files from file from another HD altogether. Things were certainly a mess. What I really wanted was the exact same set of documents on both my desktop and my laptop and a way to keep them in sync. I settled on SyncToy a free tool from Microsoft, and set to work. Here is how to do it the way I did:

The first problem you’ll probably run into is that of hard disc size. Let’s face it, laptops don’t have anywhere near the hard disc size of your typical desktop. For many of us our ‘My Documents’ folder is too large to copy to our laptop. The problem here is one of definition. What I want to sync and take with me everywhere is my documents. What I have under ‘My Documents’ is a lot more than that. What we need to do is separate media from ‘documents’. I have a lot of pictures (had a digital camera since 98, and scanned every I had previous to that). I also have a lot of music (who doesn’t) and a fair amount of video. Now I certainly want to back that stuff up, and I might want to bring some of it with my, but not all. For the purposes of this article I just want documents however so let’s get them the media out of the picture. SyncToy, like most sync utils syncs ‘folders’ and sub folders. It is not easy to exclude sub folders so my best strategy is to move media out of ‘My Documents and put it somewhere else’. Use explorers ‘cut’ and ‘paste’ to move these items to another spot on your hard drive. (Using Cut instead of copy and then delete will allow the OS to keep track of where you moved these to. This will keep your start menus ‘My Music’ and ‘My Pictures’ links functional). Do this for both computers! I put my media here:

Note I took a hint from Vista and dropped the ‘My’ prefix. Let’s face it, we’ve already established that these are ‘My’ files. No wonder people call XP ‘My First OS’.

After moving out your media you should be left with a much more reasonable sized folder. Next you need to get a bit organized. This is a good time to clean stuff up, zip older junk, and decide what you can throw away. If you already have some of your data on the second machine either make sure to mirror any folder structure changes you made. Or better yet, if you already know that some of the folder are either already in sync or out of date just ‘delete’ them from the target side. Another important consideration is any data that is machine specific that could conflict with the other side. Unfortunately the bets way to deal with this is to get it out from under ‘My Documents’ and put it somewhere else. Most behaved apps already do this.

You need to setup a share on the ‘target’ folder you want to sync. Before you do that you need to decide which computer you want to use to do syncing, SyncToy will refer to this as the ‘source’. This is not really required by SyncToy, and I’m sure you could sync from either side, but I want to keep things simple so I decided I’m always going to run the sync from my laptop. I consider my desktop the master (it is on 24/7) but from my laptop’s point of view this will be the ‘target’. The Laptop is only intermittently connected. I chose to do all my syncing from the laptop since I can only do it when the laptop is booted up anyway. So I installed SyncToy on my Laptop, and created my share on the desktop. I set it up with full access to my account and removed access for ‘everyone’ (else). Note: use the full path to ‘My Documents’ not the shortcut that file explorer gives you.

Once you have the share setup you need to create a new folder pair in SyncToy. Start up sync toy (on the laptop) and click on ‘Create New Folder Pair’. Follow the wizard. I made the left folder my laptop’s ‘My Documents’ folder and the right folder point to the desktop’s share. For your ‘My Documents’ folder you need to drill down to the folder under ‘Documents and Settings’, don’t just take My Documents directly. E.g. c:\Documents and Settings\Username\My Documents. For the right folder you can type in the path to the network share or try and browse to it. Next you need to choose the type of Synchronization. There are various options (these are described in the help file), some are like one way publish or a subscribe, some combine both sides but never delete. For our purposes, a full two way sync is needed, choose ‘Synchronize’. Finally you need to Name your Folder pair. Since I sync folders from multiple computers to my laptop I make sure the remote computer name is included here. E.g. My Documents (Firefly). – Where Firefly is the name of my main desktop machine.

Once you have a pair setup you can begin sync. One of the cool features of SyncToy is the ability to preview your operation before you apply it. Click on your new folder pair, and then click ‘Preview’. This is great since it takes some of the worry out of the process. You can also modify or un-select operations before you run the sync. The preview window hows the source and target paths so you can figure out what is going where. Also the various operations (update, rename, new, remove) are color coded. The first time you do this on your documents folder you need to pay careful attention to what is going on. If you are like me you have done a fair amount of manual copying back and forth between the machines so things are probably in crazy shape. The first time I did this I had years of manual syncing and modifications to resolve. I had to stop many times, and manually moves stuff around before I would turn the sync loose. Just cancel the preview, make your changes and run it again. One note of caution, syncToy is pretty smart, sometimes too smart for it’s own good. If it finds the same file (name, size etc) in two different locations between machines it won’t just duplicate it, rather it will move one of them. It may even decide that two differently name folders contain a large overlap so it will merge them into a single folder when done (pretty smart but it may just flip a coin to decide which folder name to keep). Pay attention to this before your first sync you may have to hunt around for some of your stuff. One caveat: You should probably uncheck any SyncToyData folders. I’m pretty sure these need to be unique per each side.

Another side note; normally syncToy just uses the filename, size and date to determine if two files are equivalent. If you think you REALLY want to be sure you can change the options for your folder pair to ‘Check file contents’. Doing so will cause it to perform a SHA1 hash on all files. It will be slower but it will never be wrong.

When you are pretty happy with the preview go ahead and hit run. After it is done you will be fully in sync – congrats. Like with Google Bookmarks Sync you may have to do some cleanup the first time all your stuff is merged, but after this one time hit, things will be smooth sailing. From now on, all future syncs will be incremental, and much quicker. Also you now have a backup of your important stuff. A word of caution avoid conflicts. A conflict is when the same file changes on both sides between syncs. No file sync tool that I know if is going to crack open your 50 page word document and try and merge it for you. The best way to avoid it is to sync often. Since I base all my syncs from my laptop, I just sync before I grab it to go do some work, and sync again when I get back. The MS site has some additional tips like setting up a schedule to sync automatically and stuff like that. Good luck and happy syncing.

Comments (2)
Paul, June 11, 2006 09:24 PM:

I really need a Mac client for something like this. In fact, a universal syncing tool was one of the product ideas that I've been thinking about.

George, June 12, 2006 05:30 PM:

Paul, is this what your looking for? Unison

All links will be marked with the nofollow tag, making them useless for search rankings. Any posts containing spam URLs will then be deleted.