You have two Windows Home Servers and you want to keep the files on the folder shares synchronized (i.e. mirrored). Why would you want to do this? Maybe you're ultra paranoid about hardware failure. Maybe you just built up a new powerful DIY box (to replace an older server) and want to weed out any stabilization issues with the new machine before you do the actual cutover. Whatever the case may be, how do you go about keeping the data on the two servers synchronized?
This article will show you how to use a free application (um, toy) from Microsoft called SyncToy 2.0. I first showed you SyncToy back when talking about the Flip Mino HD, so forgive me if this article appears to repeat some of the steps outlined there.
- Download the SyncToy 2.0 installer onto one of your Windows Home Servers. I decided to "push" files to the other server instead of "pulling" them, but I don't think either way matters very much.
- Remote into your WHS. You are installing the software from the desktop of your server, not from a client PC.
- Run the installer and you will see a dialog asking permission to install Microsoft Sync Framework. SyncToy (the application) uses this framework to do it's stuff.
- After the framework installs, SyncToy the application will be installed.
- I won't bore you with the next 4-5 screen, but basically you can just click Next accepting the defaults. The app will then install and you click Close.
- With SyncToy installed, we will now setup the folder pairs that you want synchronized. A "folder pair" is just that: a pair of folders (one on the "left" and one on the "right") that you want to keep in sync.
- Click Start, All Programs and the on SyncToy 2.0
- When SyncToy first runs there are no pairs setup, so click on Create New Folder Pair.
- In my case, I am syncing data between my current server named HOMESERVER and the new one named SERVER. Clever names, huh? My goal is to have the server reflect any changes and/or new files that are on homeserver. Essentially server will become a mirror of homeserver.
- With that in mind, we will start with the Photos share. On the left, I type \\Homeserver\Photos and on the right \\Server\Photos and click Next.
- Next I select Echo as the type of synchronization and click Next. Echo will keep the right computer looking just like the one on the left.
- The last step is naming my pair. Type in something appropriate and click Finish.
Repeat this procedure for each folder share that you would like to synchronize (probably all of them). Note that when syncing your Users share, you must create a separate pair for each user (e.g. \\HomeServer\Users\Donavon and not just \\HomeServer\Users).
At this point my pairs look like this (above). Let's see if we have things setup properly. Click on All Folder Pairs then Preview All. SyncToy will show you every action that it need to take, but in Preview mode it doesn't actually perform the actions (we'll have it do that later, while you are sleeping).
Scheduling
Once you have all of your pairs defined, we need to schedule these to run unattended and in the background. SyncToy 2.0 does not do this for you, but we can use the scheduler built into Windows 2003.
To schedule a SyncToy to run as a task:
- From the Start menu, select All Programs - Accessories - System Tools - Scheduled Tasks.
- Select Add scheduled task to start the Scheduled Task Wizard. You will see a list of possible programs to run.
- Select Browse and locate the SyncToyCmd.exe (in the Program Files\SyncToy 2.0 folder)
- The wizard will next prompt you for a name and how often you want to run the scheduled SyncToy (for example, daily, weekly, et cetera). Select a frequency (I chose Daily) and a name that makes sense, such as SyncToy.
- The next page asks when to start the task. Select a start time. 3am seems like a good time. That should give your WHS backup time to complete. You can adjust this time if necessary.
- The next page asks for the user name and password to run the program under. You will likely choose teh username Administrator. Please note that you should use the same username setup on teh opposite server and use the same password in order for the folder share to work.
- The final page contains an option to open the properties dialog when the wizard ends. Select this checkbox.
- Modify the Run textbox to include the –R command line option. –R all by itself will run all folder pairs that are active for run all.
- When you are finished the dialog should look like this:
Note: If the folder pair name contains a space, surround it with quotation marks, as the example above shows. For another example, assume that SyncToy is in the folder named C:\Program Files\SyncToy 2.0 and that you want to run a folder pair named "My folder pair." Enter the command line as follows, including the quotation marks: "C:\Program Files\SyncToy 2.0\SyncToyCmd.exe" -R "My folder pair." Note that there are two sets of quotation marks in this case: one is around the path to the SyncToy program file and the other surrounds the folder pair name.
Verifying
After you let it run overnight, the next morning you may want to verify that the sync actually worked. You can spot check a few files, but there is a better way. Remember the Preview All procedure that we ran above? The first time it yielded a list of operations to perform. If SyncToy successfully ran, there should ne no operations to perform at this point. Run SyncToy and click on All Folder Pairs then Preview All.
SyncToy also keeps a handy log file that will show you all operations performed. Click File, View Log.
Conclusion
SyncToy is a useful little utility that WHs users should be aware of. This article talked about keeping two servers in sync. But you could even use SyncToy to initially get two servers in sync (and to verify that they are in sync) before decommissioning your old server (i.e. use SyncToy as essentially a migration tool). Even if you don't need it right now, keep it in mind. I bet you will find other instances down the road where SyncToy will come in handy.