1 Introduction

1.1 Goals

1.2 Notes

2 Exercises - BackupPC : Restoration

2.1 First configuration

2.1.1 To restore localhost

On http://hostN.ws.nsrc.org/backuppc, we are going to restore using create/write permissions

  1. Select Host summary in the Server menu on the left, then click on localhost

  2. From Edit config, click on the "xfer" tab :

Change the content of 'TarClientRestoreCmd' label :

From

    $sshPath -q -x -l root $host env LC_ALL=C $tarPath -x -p --numeric-owner --same-owner -v -f - -C $shareName+

to

    /usr/bin/sudo LC_ALL=C $tarPath -x -p --numeric-owner --same-owner -v -f - -C $shareName+

Don't forget to save it.

2.1.2 To restore remote host hostY

On shell (terminal - command line), we are going to give to the backup user permission to create directory:

  1. Edit the sudoers file
$ sudo visudo

Add this line at the end of file:

    backup ALL=NOPASSWD: /bin/mkdir
  1. Make sure backup user has permission to update the destination file
$ ls -l DESTINATION_PATH

2.2 Delete a file!

Let's start by deleting a file we will restore.

On the host you are backinup (hostY), go to the /var/www/html directory, and remove the file index.html

$ cd /var/www/html
$ sudo rm index.html

Oops! :) It's time to restore that file!

2.3 Go to the BackupPC web interface.

http://hostN.ws.nsrc.org/backuppc

Note: instructions below are taken from http://backuppc.sourceforge.net/faq/BackupPC.html

Let's restore from the last backup.

  1. Select Host summary in the Server menu on the left, then click on hostY

  2. From hostY Backup Summary, click on the backup number to restore. You can navigate the shares and directory tree for that backup

BackupPC's CGI interface automatically fills incremental backups with the corresponding full backup, which means each backup has a filled appearance. Therefore, there is no need to do multiple restores from the incremental and full backups: BackupPC does all the hard work for you. You simply select the files and directories you want from the correct backup vintage in one step.

You can download a single backup file at any time simply by selecting it. Your browser should prompt you with the file name and ask you whether to open the file or save it to disk.

Alternatively, you can select one or more files or directories in the currently selected directory and select "Restore selected files". (If you need to restore selected files and directories from several different parent directories you will need to do that in multiple steps.)

In our case, navigate to /var/www/html and check the box for index.html.

If you select all the files in a directory, BackupPC will replace the list of files with the parent directory.

Then click Restore selected files

You will then be presented with a screen that has three options:

With this option the selected files and directories are restored directly back onto the host, by default in their original location. Any old files with the same name will be overwritten, so use caution. You can optionally change the target host name, target share name, and target path prefix for the restore, allowing you to restore the files to a different location.

Once you select "Start Restore" you will be prompted one last time with a summary of the exact source and target files and directories before you commit. When you give the final go ahead the restore operation will be queued like a normal backup job, meaning that it will be deferred if there is a backup currently running for that host. When the restore job is run, smbclient, tar, rsync or rsyncd can be used (depending upon $Conf{XferMethod}) , but in your case, let set it to "rsync", to actually restore the files.

With this option a zip file containing the selected files and directories is downloaded. The zip file can then be unpacked or individual files extracted as necessary on the host machine. The compression level can be specified. A value of 0 turns off compression.

When you select "Download Zip File" you should be prompted where to save the restore.zip file.

BackupPC does not consider downloading a zip file as an actual restore operation, so the details are not saved for later browsing as in the first case. However, a mention that a zip file was downloaded by a particular user, and a list of the files, does appear in BackupPC's log file.

This is identical to the previous option, except a tar file is downloaded rather than a zip file.

If you selected a Direct Restore, go to /var/www/html on hostY, and verify that index.html has been restored!