How to Manually Migrate a VZ Container

By | 1 May 2012

Have a tricky VPS that vzmigrate just can’t move? Luckily, Virtuozzo (and OpenVZ for that matter) are pretty simple in terms of how the containers are set up. You’re mainly dealing with two locations that data for the container is stored:

/vz/private/$VEID
/etc/vz/conf/$VEID.conf

To manually move a container to another node, all you need to do is copy those folders:

rsync -av /vz/private/$VEID $newserver:/vz/private
rsync -av /etc/vz/conf/$VEID $newserver:/etc/vz/conf

Then on the server server, just start it right up. You do need to have the container’s OS template installed on the new node, as referenced in the container’s config file.
This same process also applies to cloning a VPS, which is particularly useful on an OpenVZ server where the vzmlocal command isn’t available. All you have to do is use similar commands to rsync the container’s private folder to a new VEID:

rsync -av /vz/private/$VEID /vz/private/$NEWVEID
rsync -av /etc/vz/conf/$VEID /etc/vz/conf/$NEWVEID

Then just change the hostname and ip variables in the new container’s config file.

surce: http://www.thevirtuozzoadmin.com/how-to-manually-migrate-a-vz-container/