How do I move my production servers into a development VM?

I have about 3 servers that are probably almost 10 years old, all using code what one might consider worst-practices for programming's sake.

I'm terrified of making changes to the thing (production servers have always been the development platform before I got here, and I really want to change this), but we have no real way to emulate the server perfectly other than use the thing.

So we have to change the website it's running, and I really don't want to go "Oops." Advice on how to do something like migrate these 3 beasts into VMs on my desktop or something where I can safely do some development work without feeling like I'm the star of Mission Imposable, hanging from a thread over laser beams and sweat dripping off my face as I carefully do my work?

To give you an idea of what I mean by worst-practices... we have 14 copies of the "main" block of code, a 14,000 line monster of "please, repeat yourself" code worked on by seven developers over ten years, all sitting in the root directory of the production web server. I need to change this, I need to make serious fixes, but it's like playing kaltoh while being shot full of mind-altering drugs. Help?

Servers are windows2000 server, database is MSSQL 2008, servers run IIS with PHP and ASP. A hundred applications I have no knowledge about share the server space. One server manages our AD. Sharepoint exists but isn't used. Some "log me in" software that nobody knows about exists on there. Postgres is running for some reason. Firewall software is on there. Exchange 2008 is on there. Antivirus server is on there... in all honesty, I just want to replicate the website.


Solution 1:

VMware has a tool called VMware vCenter Converter specifically for transitioning existing physical machines to a virtual environment.

For servers predating XP/Server 2003 I would look at using something like Norton Ghost or Acronis to make a backup, then restore to the virtual hardware.

Solution 2:

Before risking your production server with complicated P2V solutions, you might want to try cloning your production server with Drive Snapshot. In a nutshell, the steps required are:

  • Download Drive Snapshot from http://www.drivesnapshot.de/en/
  • Run the standalone snapshot.exe on the production server. No installation or reboot required
  • Image your drives
  • Restore drive images to a VM

Keep in mind that imaging/cloning/p2v is very HDD intensive. Try to do it during server's off peak period so as to minimize the performance impact on existing applications.

Solution 3:

Make an image of the server (Clonezilla, ghost4unix). Try with VMware Converter to copy the machine. If it is not working, try to use Clonezilla image to restore to a VM. (Or you use dd plus netcat).

Then make the cleanup. Move each production service to a new VM. And use these VMs as production servers. This way you will test that you are in control of the new servers. Document everything. For each prod VM, create a QA VM and a Dev VM. The developers will have access exclusively to Dev VMs. Do not give them admin rights. You will use QA VMs to test their new code. Take the code for migration to QA and deployments to Prod only from source control.