5.14. VPS backups
General information
VPS backup is an image of the state of the operating system installed on the server. Working with backups is performed in the "VPS" section on the "Backup" tab.
There are two types of backups:
- Automatic — created automatically by the system once every 4 days. When a new copy is created, the old one is deleted, so only one latest automatic copy is always available for restoration.
- Manual — created manually by the user.
Backups can be restored or downloaded.
Create
Important points:
- Request for creating a backup cannot be canceled.
- A new request for creating a backup can be submitted only after the previous one has been completed.
- A maximum of 5 manual backups can exist at the same time.
Specify the desired backup name and click "Create":
Restore
Attention!
Request for restoring a backup cannot be canceled.Important points:
- After changing the plan of VPS it is not recommended to restore the backup that was created before its change.
- Restoring a backup always returns the user's root password that was set at the time the backup was created.
In the row with the desired backup, click "Restore":
Download
Notes:
- The backup is downloaded as a system image. The format of the downloaded image depends on the type of virtualization used: for Xen —
img, for KVM —qcow2. - A downloaded backup cannot be uploaded back and restored.
- The
imgfile is a complete working copy of the VPS. If you configure the Xen hypervisor on your PC or another server, you can start the VPS from this file (at a minimum, this will require additional manual network reconfiguration).
In the row with the desired backup, click "Download":
Working with downloaded image
Notes:
- The commands in the instructions must be executed on a Linux system. On Windows you can use WSL (Windows Subsystem for Linux).
qcow2images can be converted torawusing theqemu-imgutility, after which the converted image can be mounted using these instructions.- Instead of
vps.img, use the name of your image or the absolute path to it. kpartx,mountandumountneed to be run as root user or usesudo.- Data from
qcow2images can be extracted using the 7-Zip archiver.
To access the contents of a downloaded image, you need to mount it on your system — create virtual block devices and mount the desired partition. After that, you will be able to view and copy any files and directories from it. When you are done, you can unmount the image.
Mount image
View a list of partitions in the image:
fdisk -l vps.img
View a list of virtual block devices that will be created on the system:
kpartx -l vps.img
Create virtual block devices in the system:
kpartx -av vps.img
Mount the desired partition:
mount -o loop /dev/mapper/loop0p3 /mnt/vps
In command:
- Instead of
loop0p3, use the device and partition number from the output of the previous command. /mnt/vps— directory where the contents of the partition will be mounted. Note If the directory does not exist, create it with themkdir /mnt/vpscommand.
Get information about images and devices
Corresponding image files to virtual block devices in the system:
losetup --list
Unmount image
Unmounting the partition:
umount /mnt/vps
Remove the virtual block device from the system:
kpartx -d vps.img