Backup VPS using vzdump

Vzdump is a utility to make consistent snapshots of running OpenVZ containers. It basically creates a tar archive of the container’s private area, which also includes the container configuration files. It stores the backup on the disk in a single tar file.

Download vzdump rpm packages from http://download.openvz.org/contrib/utils/vzdump and install the rpm package on the server.

# rpm -ivh vzdump.x.x.x.rpm

How to backup container.

Simply dump CT 777 — no snapshot, just archive the container private area and configuration files to the default dump directory, usually in /vz/dump.

vzdump 777

Use rsync and suspend/resume to create a snapshot (minimal downtime).

vzdump –suspend 777

Backup all containers and send notification mails to root.

vzdump –suspend –all –mailto root

Use LVM2 to create snapshots (no downtime).

vzdump –dumpdir /space/backup –snapshot 777

Note that using LVM2 and vzdump to create snapshots requires 512Mb of free space in your VG.

How to restore the container.

Restore the above backup to CT 600:

vzrestore /space/backup/vzdump-777.tar 600

OR

vzdump –restore /space/backup/vzdump-777.tar 600

Courtesy: http://wiki.openvz.org

One thought on “Backup VPS using vzdump”

Leave a Reply

Your email address will not be published. Required fields are marked *