Erik @ IMH

How to migrate a Virtuozzo VPS to OpenVZ

Archived post, originally published August 18, 2011. Kept for reference — commands and package names reflect the distributions of the time and may have changed.

To migrate from Virtuozzo VPS to OpenVZ you must “rsync” root area to private area to avoid incompatibility of OpenVZ and Virtuozzo Cache Templates.

1. Create your VPS with id 3 using your desired template (for example)

# vzctl create 3 --ostemplate ubuntu-11.04-x86_64 --conf unlimited  
Creating container private area (ubuntu-11.04-x86_64)
Performing postcreate actions
Saved parameters for CT 3
Container private area was created

2. Start your VPS

# vzctl start 3
Starting VPS …
VPS is mounted
Setup slm memory limit
Adding port redirection to VPS(1): 4643 8443
VPS start in progress…

3. Now on Virtuozzo we have to stop and mount VPS

# vzctl stop 3
Stopping VPS …
VPS was stopped
VPS is unmounted

# vzctl mount 3
VPS is mounted

4. Now we have to make a migration of files with Rsync to OpenVZ Node

# rsync -a -e ssh /vz/root/3 root@OpenVZ_node_IP:/vz/private/
# rsync -a -e ssh /etc/sysconfig/vz-scripts/3.conf root@OpenVZ_node_IP:/etc/sysconfig/vz-scripts/

5. On OpenVZ System, we now start and enter on your OpenVZ node to see if migration works correctly:

# vzctl start 3
Starting VPS …
Initializing quota …
VPS is mounted
VPS start in progress…
# vzctl enter 3
entered into VPS 3

6. Success!