I've been having some great conversations with a few developer friends lately, as we all hate having to "re-pave" our machines every time we upgrade hardware, or our laptop dies and we have to sort out a replacement so we can continue to work.

People think that becoming a developer is all about code, and in some cases, that's true. I think, though, that being a developer means solving the problem at hand - whatever the technology, language, or platform. A lot of us are purely focused on our specialism - be that .NET, webforms/MVC, front-end HTML5/CSS3/jQuery, etc. What about the metal behind it? All that code that makes what you write, possible - the operating system, web server, network protocols, and stuff that just makes your brain crackel with excitement? OK, maybe that's just me...

Anyway. Developers hate repaving machines. Some of you probably have IT departments for doing that kind of stuff, but for the lone freelancer, one dead hard-disk (as happened to mine earlier this week) means re-installing everything afresh on a new disk. And there are ways of making this stuff quicker, if it happens to you regularly (disclaimer: I'm on laptop number 7 since March 2008, but six of those have been in the last 2 years...).

Planning for failure is something every developer should do, and that includes your hardware failing too. Here's a quick step-by-step plan on how to make sure you can minimize that downtime.

  1. Source control. If you don't know what it is, find a shotgun and a mirror... wait, I'm kidding.

    Seriously though, if you're writing code without source control, it's like sleeping with your girlfriend, without contraception, a week before her period, drunk and blindfolded. One slip, and something goes wrong, and you don't remember how the hell it happened, or how you can fix it. And man, your head hurts.

    Get source control. Anything except Visual SourceSafe will do, as long as you can commit changes to a remote server via HTTP/S. I personally use Subversion, but I'm starting to lean towards using Git, as my hosted project provider has support for both. This way, anything goes wrong, not a big deal, you have the entire history of everything you changed and you can re-download it on demand. Assembla (my old provider) offers free private spaces up to 1GB in size. If you're doing it professionally, pay for pro tools - I use CodeSpaces' $29.99/mo plan, for up to 10 users & unlimited projects, and I pay for it every 6 months in bulk. I get project, task, user, time and code management - it's the best hosted provider I've used by far (with the exception of their API, but that's for another post).

  2. Get an external hard disk, and back up to it weekly.

  3. Image your hard disk with all your apps pre-installed. This is a tricky one, and the main meat of this blog post. I'm also using Windows 7, so YMMV with different operating systems. Here's a really sweet video walkthrough on how to generalise, and then capture, a full system image, including installed applications (basically, go nuts with installing your copies of Visual Studio, SQL Server, Office, etc. etc.), and store this in a .WIM file, which can then be used to either re-deploy to other systems (IT admins, this one's for every time you hire a new dev team member), or used to re-image your own system (i.e. your hard disk just died, like mine did last week).

If you just arrived here because your hard disk frazzled at 2am last night, then my next post is a step-by-step walkthrough on how to restore the image that (hopefully) you created from watching the above video.

Watch this space!