Backup...My Way!

Part of IT is being a disaster recovery expert. And when you're a DR expert you know of the love/hate relationship of backup & recovery. Now this post isn't dealing with enterprise backup is in fact how I personally do backups to safeguard my data.

The reason I am writing about this is that I do it...differently I believe. I often do the wipe/reload of my main machine for a couple reasons: to test new configurations, try new installation scripts that need to be run on hardware or to upgrade/test new software as my main OS. Depending on those combination's the way I do a restore is different. One of them I want to restore to exactly the way it was before I wiped. The flip side is that I want to restore just my user data but have a clean OS. Before Vista it was pretty messy since I would have to use 3rd party tools. But thanks to Microsoft, we have some cool new tricks.

When using Vista Business, Enterprise or Ultimate you get the privilege of using Windows Backup & Restore. There are two main paths you can take when using this. File based or image based. Let me explain:

File based is basically a copy of all your user data (everything under your home folder) and zips them up into manageable ZIP packages. There is catalog data associated with them so you can restore these files easily. Image based is basically what it sounds like and makes its debut in Windows Vista. What Vista is able to do is take a sector based backup of your entire PC and create an image out of it. Even better, that image file a VHD file! And this is where the fun begins.

So what happens when you want the best of both worlds? You want the cabability to restore individual files, but also if needed restore the entire computer to the original state? You can't through the GUI pull individual files from a Complete PC Backup. But you can do it from the command line. Here is how. First, you need to install Vhdmount. This is part of the Virtual Server 2005 R2 installation which you can find here. Do a custom configuration and only install that tool unless you want the full program. What this tool will do is mount the VHD as a logical drive and than map it a letter. Here is the run down on the command line and syntax:

vhdmount.exe /m {vhd path} {Drive Letter} -Plugin and mount the drive
vhdmount.exe /u /d {vhd path} -Unmount drive and unplug

You can then traverse the drive and pull your data into the appropriate folders in your new Windows installation (or wherever else you want them).

Now there are a few issues that are specific if you're doing this on Windows 7. First, sometimes the driver to mount VHD files are not installed/registered correctly. Head on over to this thread to fix the issue. You will need to manually load the device driver. For general troubleshooting of Vhdmount you can also setup tracing which can be found here