Restore VPS from Backups

From Wiki
Jump to: navigation, search

VPS Restore procedure

Note: If restoring to a different node you will also need to restore the cache.

1. Create new VE from template:

vzmlocal -C 1xx:1xx

If that doesn't work then you can install a fresh template.

bash /vps/bin/template-install.sh -t vps1 -v 107

2. Mount it:

vzctl mount 101

3. Set the VPS quota

VPS1 - vzctl set $VEID --diskspace 52428800:52428800 --diskinodes 13844753:13844753 --save
VPS2 - vzctl set $VEID --diskspace 104857600:104857600 --diskinodes 27689506:27689506 --save

4. Restore the account from the last full backup. This can be done directly over ssh from the backup server. For example:

 ssh vzxxx.example.com "cd /vz/private/; tar xpzvf - 101/" < 101-2007-10-23T045447-0400\@vz060b.example.com-I.tar.gz

5. Restore the config file, for example:

tar xzvf 108-2008-08-23T030716-0400\@vz203b.example.com-i.tar.gz 108.conf
scp 108.conf vz203:/etc/sysconfig/vz-scripts/

6. Unmount and start the instance.

vzctl umount 1xx && vzctl start 1xx