Saturday, September 22, 2012

Legacy Windows Rsync Backup to FreeNAS

I have some old Windows servers (10 years and counting) and I have been using rsync to back them up to my FreeNAS box. It has been working great for me.

First of all, I do have my Windows servers backup in virtualized format. However, those are only one-time snapshops that I run once in a while. These are classic ASP IIS web servers that I can easily put up on a new VM. However, many of these legacy servers generate gigabytes of data a day in their repositories. Running VM conversion daily is not ideal.

My solution was to use some sort of rsync solution just for the data repos. I've tried some applications that didn't work too well with Samba shares and these old servers have slow I/O. Copying files to external sata or usb drive was not ideal. We've moved on from Windows to Linux and do not have any Windows file servers of capacity to provide network backups.  Hence, I decided to use Delta Copy with FreeNAS. So here is a little write up on how to set it up. I have 4 Windows 2000 servers backing up daily with this method.

First, download Delta Copy and install it. It is open-source and pretty much free. It is basically a wrapper for cygwin's rsync. When you install it, it will ask you to install the Server services which allows you to run it as a Rsync server on Windows. You don't need to do this. Instead, you will be just using the Delat Copy Client application. But before we do that, we will need to configure our Rsync service for our Windows Clients on FreeNAS.

In FreeNAS, go under Services , Select Rsync >  Rsync Modules > Add Rsync Module.



Then fill out the form; giving the module a name and set the path. In my example, I simply called it WIN and linked it to a user called backupuser.



This process is much easier than trying to configure the daemon rsyncd.conf file by hand.

Now, on the Windows Client, start the DeltaCopy Client. You will create a new Profile.
You will need to enter the IP of the Rsync server (FreeNAS) and specify the module name which will be called "Virtual Directory Name."  When you pull the select menu, the list of Rsync Modules you created earlier in FreeNAS will populate.





You can set authentication. On the server, you can restrict by IP and do other things to lock down your rsync. 


Next, you will add folders (and/or files) you want to synchronize.



Once the paths are set up, you can run a sync by right clicking the profile name.



Here, I made a test sync to a home folder of a virtualized windows box. As you can see, I mounted the rsync volume on my mac to see the progress. The rsync worked beautifully. DeltaCopy did what it was told.


Once you get everything working. The next thing to do is set schedules. If you done tasks schedules in Windows before, it is pretty straightforward. DeltaCopy has a link in the application to directly create a new task for you. I set my backups to run nightly and it has been working great.



There you have it. Windows rsync to FreeNAS using DeltaCopy.
The nice thing about FreeNAS is you don't have to modify /etc/rsyncd.conf files. Everything can be done in the web admin.



2 comments:

  1. Thanks for the blog - this really helped me. The one issue I'm having now is that the permissions change when writted to the destination. How can I preserve the permissions, modified date/time, etc?

    ReplyDelete
  2. Thank you for this... It has saved my bacon trying to synchronize music between my pc and the home server... Now to move onto bigger things!

    ReplyDelete