Recently I overwrote an important CS file with an older (bad) copy. I had no backup copy and I immediately did a face palm. I could have avoided this with Shadow Copy.
Shadow Copy provides a clean way to view previous versions of the source code files and restore. Today I added a new drive letter to the VM with Shadow Copy enabled to keep an extra safety net. Hopefully if I overwrite the file “precious-8-days-of-coding-only-copy-in-the-world.cs” with garbage again then I’ll be able to quickly recover.
1) Create “code.vhd” from Computer Management
2) Initialize the disk
3) Detach “code.vhd”
4) Add new disk to Virtual Machine (Oracle VirtualBox here)
5) Boot Virtual Machine and create new partition (F:\ here)
6) Enable Shadow Copy on the F:\ drive. I set for every 10 minutes.
7) Move “My Documents” to F:\
By moving “My Documents” to the new F:\ drive letter all new Visual Studio and InfoPath projects will be stored here. Another benefit is I can backup the small “code.vhd” drive more easily than the full VM. Hopefully this helps someone else avoid a face palm.