Migrate VMs between standalone PVE hosts

Alessandro 123

Well-Known Member
May 22, 2016
653
24
58
40
Which is the best method (I can poweroff the VM) to migrate a VM from 2 standalone (not in a cluster) PVE hosts ?
Both hosts are on the same network.

There is also a way to livemigrate ?
 
you could just make a backup and restore the archive on the other node.
Is possible to do this in one step ? Something like
Code:
newhost$ vmbackup oldhost 111 | vmrestore

Just to avoid to backup hundreds of GB locally and the restore hundreds of GB to the new host (a lot of hours needed as this is a 2 step operation via network)
 
Is possible to do this in one step ?
hmm, yes. there are a couple possibilities.

for example via ssh:
Code:
vzdump 111 --stdout | ssh root@newhost -- qm restore - 123
where 111 is the old VMID and 123 the new one that will be restored on the host.
though be aware that this is not very robust, as you'll have to start over the whole backup if it's terminated for some reason (it can also take a while to complete).
alternatively you can look into "sshfs" which would allow you to mount a directory from the 2nd host on your 1st one.

another option is using a network storage (like NFS,SMB etc). if you mount the share on both hosts, you could just make a backup on the first one and save to the NFS share, then restore it from the share on the 2nd host.
 
  • Like
Reactions: Dunuin
Can I do the same PULLING the backup from a remote server instead of pushing it ?
sure, if you stored your backup on a network share, then you can just pull it from the 2nd server and restore
 
No, wait, I need a direct export , not a mount to use when backupping and restoring. It's better, in my environment, risk to have to restart everything from scratch than the downtime needed to backup and then restore in 2 steps.
 
No, wait, I need a direct export , not a mount to use when backupping and restoring. It's better, in my environment, risk to have to restart everything from scratch than the downtime needed to backup and then restore in 2 steps.
you can try like this:
Code:
ssh root@oldhost -- vzdump 111 | qmrestore - 123
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!