I’ve written a simple C# Console Application that will synchronize two folders or drives on your computer.
I am eventually going to build a home server to house all of my family photos, music, movies, and other media. However, I am not in the market for purchasing any server software or hardware at this time. I wanted a simple way to backup all my data. I understand there are many different options already available for backing up data, but I didn’t want to install some third party app that comes with a bunch of things I don’t need. I’ve decided to do this using Microsoft’s Sync Framework.
D:\ Drive has 4 Documents:
E:\ Drive has 0 Documents:
This would be the end result:
My plan is to add new files to the D:\ drive and then regularly copy that drives entire contents to the B:\ drive. My old method was having my Operating System (OS) and all my files on one drive, and then manually backing up all my files onto an external hard drive. I purchased a new 1TB Hard Disk Drive (HDD) and a 250GB Solid State Drive (SDD). I moved all of my files to the new HDD and then removed them all from the existing HDD. I then moved the OS to the SSD, and then wiped the existing HDD. At this point I have my OS on the SSD, all of my files on the new HDD, and an empty existing HDD. After renaming the drives that that the letters are how I want them, I’m ready to move all my data.
Launching the program will just open a console window, and tell you that it is syncing D:\ and B:\. I have these values hard-coded so I will never accidentally sync the wrong drives or lose any data. I originally had the program ask the user to enter in each path manually, but there is way too much room for error there.
When it is complete, it will tell you that it has finished and tell you how long it took:
This example was syncing about 200GB worth of files. 55 seconds is a reasonable amount of time in my opinion. If you were to select all files in the D:\ drive, and then move them all to the B:\ drive manually, it would take significantly longer.
Once you have downloaded the SDK from this location, you are free to use the framework in your C# application. Here is an example of what my source code looks like:
I hope someone can find this useful. Thanks for reading!