I recently had to rescue a legacy application that was running on an old Compaq Proliant server. This custom application is primarily a web application running on MS SQL Server, however there are various services and automated tasks and the application is fairly well embedded onto this hardware. The application has gone through various changes and development teams since it was originally written in 1997, but has always lived on this particular Windows NT 4.0 Server.

The machine itself is huge, heavy and requires three power cords to run. It’s also extremely loud. Though it was a mighty workhorse in it’s day, now there are cellphones and PDAs that would give it’s CPU a run for it’s money. I thought the hardware was so old that it would make sense to migrate the whole thing to a virtual disk image and run in using Parallels. What I had thought would only take an hour or two wound up being an entire weekend saga. But end the end I was victorious and the virtual server now runs like a champ on my Mac Mini. What follows are the steps and software tools that I used to make the migration.

Note: if you are using an Windows OS more recent than NT, you can use Parallels Transporter to easily convert an older server into a virtual machine. The technique below is much more labor, however will work on older Windows systems and, theoretically, any other OS. Also, I suspect these steps could be followed for use with another emulator such as VMWare or VirtualBox.

The first step of the process was to make a disk image of the drive. This actually can be done using a variety of GUI utilities if you can physically remove the drive and place it into another machine. In my case the two disk volumes were spread across 4 physical disks on an old Compaq RAID array. Not to mention they were old SCSI drives and I didn’t have the hardware to plug them into another machine anyway. What I did find was a nice little app called G4U (Ghost for Linux)

G4U basically did all of the hard work, but it didn’t quite get me all the way home. Following the G4U instructions I created a boot disk CD and booted the old hardward. G4U is a command-line utility with a command uploaddisk. This command basically converts the drive of your choosing to a raw image file and simultaneously uploads it to the FTP server of your choosing. I did this using a local FTP server and the result was a .gz file containing the raw disk image.

Now that I had the disk image the next step is to get the data out of that image and into a Parallels virtual machine. I created a Parallels virtual machine with a blank virtual drive the same size as the old server drive (actually I made it a little bigger to be safe). I then booted up this virtual machine as if I was going to install Windows, only I booted from the G4U boot disk. At the G4U prompt the command slurpdisk connects to an FTP server, decompresses the raw .gz image file to a physical drive. (In my case, I copied it to the new, blank virtual drive.)

Once this step was complete I had what should have been an exact copy of the drive from the hardware duplicated on a parallels .hdd drive file. And indeed I did have this; however, there was a problem – it wouldn’t boot! Apparently something with the old RAID controller or the conversion process had not correctly copied the boot sector. I could mount the disk image and see that all the data was there but Parallels would just not recognize the drive as being a bootable image.

I know there are ways to fix the boot sector using special fdisk options, however they tend to wipe out the data – which obviously wouldn’t work. There’s probably non-destructive ways as well. What I wound up doing, though, was to create a new Parallels machine with a new/blank drive and install on it a fresh copy of Windows NT. In other words, I basically created a regular virtual machine running Windows NT. (In hindsight I probably could have just copied any existing virtual machine that I had)

So at this point I had a) A virtual drive copy of the old hardware drive that was non-bootable and b) A clean NT virtual machine that was bootable. I needed to get the files from A onto B. I figured a straight copy using windows explorer would wipe out critical NTFS system data, but I couldn’t copy the whole partition either and lose the boot sector info. I located another free utility program called XXCOPY which promised to copy NTFS files as-is preserving all system meta-data. (Vista has a new feature called RoboCopy which may also work for this purpose.) I mounted both disk images on my main XP installation so I would work with the filesystems. I deleted all of the NT files from the clean install using Windows Explorer, thus I have a blank, but bootable drive. Then using XXCOPY I copied the old serer’s entire C drive contents to the blank, bootable drive.

To be honest, I wasn’t expecting this to work. The copy took a while, but after I was done I booted up from that drive and to my amazement it started! It took a lot of trial and error, but in the end the application was liberated from it’s old hardware and now runs happily on any decent computer with Parallels installed.