Inherited broken pve 1.9(!), trying to migrate a VM

moeffju

Member
Apr 22, 2019
7
0
21
42
Dear Proxmox forum, I have inherited a (remote) machine running Proxmox 1.9(!), and I want to migrate the VMs to a new PVE 6.x instance.

The system is in a pretty broken state with half-installed Debian packages, and the web frontend is not working. vzdump exists but does not run (Can't locate PVE/RPCEnvironment.pm), apparently a result of a botched run of the old 1.9-to-2.x upgrade script.

All guests are OpenVZ guests with storage in /var/lib/vz/root.

What is the best way to migrate their data out of the old host and into a new VM running on my new PVE 6.x? Naively I would just shut down the guests and tar up their roots and config. But there's a few things I want to double-check before running off:

1. What format does vzdump/vzrestore expect, i.e. what layout should my archives have so I can just restore them with PVE 6?
2. If that is out of the question, how do I mount the storage of a newly created VM to unpack the root in there?
 
Is it sufficient to "emulate" vzdump by doing the following:

1. rsync the VM's root to a new location
2. suspend/shutdown the VM
3. rsync the VM's root again to catch changes
4. copy /etc/vz/conf/${VMID}.conf to /etc/vzdump/vps.conf in the backup dir
5. copy /etc/vz/conf/${VMID}.{mount,umount,start,stop} to /etc/vzdump/vps.(extension).conf in the backup dir
6. tar up the backup dir

Or am I missing anything important?
How do I ensure that uid/gid and file permissions are retained correctly?