Transferring VM's from one server to another in Proxmox
Introduction
I recently got a new server (PowerEdge R710) and so I need to transfer the VM's that I have on my existing server over to the new one. There are a couple ways to do this but I chose to go with the backup to an external hard drive and then restore onto the new system.
Steps
Though some trial and error I determined how to get it done:
- First I erased every partition on the new hard drive using fdisk first I found the new drive's ID using
fdisk -l
- Then I used
fdisk /dev/sdc/
to go into the drive and delete every partition on the drive. - I created a new partition and then changed the type to a linux LVM using the hex code 31
- After that I wrote those changes to disk
- I then created the file system for the disk with
mkfs.ext4 /dev/sdbc1
- Then all that's left to do is create a new directory to mount it in with
mkdir /external/usb-drive
and then mount it withmount /dev/sdc1 /external/usb-drive
- Now you should be able to go into Proxmox and add the new drive as a directory with the path to the drive as
/deb/sdc1
in the web GUI
Now that we have a bunch of backups we now need to get them over to the new server. So I unmounted my usb drive with umout /external/usb-drive
, plug it into the new server and mount it.
To restore the VM's to the new server, simply go to the disk, select the backup you just made, and then press the restore button in the web GUI. Let that run all the way through and you should be good to go!