Linux Commands SERVER MANAGEMENT

How to migrate OpenVZ VPS ( Container )

migrate OpenVZ
migrate OpenVZ

How to migrate OpenVZ VPS ( Container )

This is a guide to migrate OpenVZ VPS ( Container ). OpenVZ (Open Virtuozzo) is an operating system-level virtualization technology for Linux.

Method 1: Using vzmigrate command

It is the simplest way to migrate OpenVZ VPS ( Container ) to another node. Run the following command on the source node.

 
vzmigrate -r no --keep-dst <Destination_Node_IP> <VE_ID>

Options:

-r --r yes|no (Remove private area)
--ssh=<ssh options> --ssh="-p Destination_Node_Port"
--keep-dst Do not clean synced destination container private area

To know more options with vzmigrate, type following command:

 
vzmigrate --help

Method 2: Using vzdump command

You need to execute some commands in Source and Destination node to migrate OpenVZ container.

In Source Node:

 
mkdir /backup
vzdump --compress --dumpdir /backup VE_ID

Options:

 
--compress It will compress the dump file in .tgz format.
--dumpdir It will specify the directory to store the dump file.

This command will save the dump file to /backup directory. You need to scp or rsync the created dump file to the destination node.

In Destination Node:

 
vzdump --restore <Backup_File_Path> VE_ID

Options

 
--restore Restore the dump file

Run the following command to know more option of vzdump command.

 
vzdump --help

That’s it!

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com

Topics