How to recover my data from my backup ? |
This document deals with the data recovery procedure from the backup of a dedicated server.
Introduction
The back up is a safe storage space of your data. It allows you to recover your data, files, documents etc... …
Before starting
Required Techniques
To make sure that the backup of your server is correctly carried out, please check:
- You have a dedicated server. No procedures described in this document are applicable to shared hosting
- You have SSH access on your server in order to execute scripts to recover the backup
- That the SSH key of the backup server is on your server
- If you have a firewall, that the IP of the backup server is authorised to connect to the SSH port of your server
Procedure
Several backup servers exist. To know which one is yours, recover the IP of your server and apply the following rule:
Ip in the form of aaa.bbb.ccc.ddd
Several cases:
213.186.ccc.ddd, with ccc < 40, the backup server is superbackup1.ovh.net
213.186.ccc.ddd, with ccc < 50, the backup server is superbackup3.ovh.net
213.186.ccc.ddd with ccc > 50, the backup server is superbackup2.ovh.net
213.251.ccc.ddd with ccc < 160, the backup server is superbackup4.ovh.net
213.251.ccc.ddd with ccc > 160, the backup server is superbackup5.ovh.net
E.g.
IP = 213.186.57.143 in the form of aaa.bbb.ccc.ddd, with ccc = 57 so backup server: superbackup2.ovh.net
Here is the process to access your back up data. Use the following command:
Replace name_module by the name specified at the time of the installation of your backup, in the form of machinename_number. By default, if you have only one backup, it will be namemachine_1, if you have 2 backups (weekly backup + incremental backup), you will have namemachine_1 and namemachine_2.
- Replace name_backup by the name given in the mail received at the end of your backup, in form of backup_date_hour
- Replace /dir/file by the file to recover
- Replace rep_destination by the place where you would like to store the file
If you have snapshots, the procedure is the same, adapt the name of the backup to the one corresponding to the required snapshot.
To list the content of your backup space:
To list the content of your backup:
Otherwise, here is a small script proposed by a customer to make the task easier, adapt it to your backup type and backup server:
#!/bin/sh
BACKUP=superbackup2.ovh.net
MACHINE=name.machine.net
/usr/bin/rsync -roa --password-file=/etc/rsync.dir/backup.pass $MACHINE@$BACKUP::$MACHINE$1 $2
echo "recovered file : $1"
echo "remise file : $2"
echo
Place it in a file such as backup.sh, set it in “chmod u+x” and name it as follows:
./backup.sh /var/named/ovh.net /root/ovh.net.zone
WARNING Never overwrite your new disk with your backup data. Doing this would overwrite the file /etc/fstab and would endanger your dedicated server.
In the same way, you must not recover it directly as this will overwrite /etc/fstab, but also /etc/ovhrelease. You risk problems at the time of your next reboot and any updates.
Shortcuts
To list the content of your backup from your server:
/usr/bin/rsync --password-file=/etc/rsync.dir/backup.pass `hostname`@superbackup.ovh.net::`hostname`