Sunday, 29 June 2014

Moving cPanel CentOSVHm on Hyper-V

Sometimes for one reason or another you just can not move VM's from one host to another.Moving the virtual machine from one host to another is just one one of the many advantages of the virtual environment over the physical.
So here is a quick list of the steps that I have needed to take when copying a CentOS install from one host to another.
  1. Create the new virtual machine.
  2. Save file permissions
  3. Rename the VHD (just in case)
  4. Copy the VHD. 
  5. Set file permissions.
  6. Change the Network configuration
And in Full
  1. Create the new virtual host and make is as identical as the one that you want to copy from
  2. Full text
  3. use icacls [Server].vhd /save file.perm to save the permissions
  4. Full text
  5. rename the VHD (just incase)
  6. Full text
  7. Copy the VHD from the old host to the new host. 
  8. Full text
  9. use icacls D:\hyper-v\BlueMidget /restore file.perm to set the permissions of the new file.
  10. Full text
  11. boot up the VHD
  12. Full text
  13. Change the MAC address of the network card(s) to match the new server
  14. nano /etc/sysconfig/network-scripts/ifcfg-eth0
    nano /etc/sysconfig/network