$Header: /home/cvs/dobackup/README.restore,v 1.3 2002/08/16 06:48:00 imorgan Exp $

Restore Mini HOW-TO for Dobackup
--------------------------------

This is a quick how-to indicating one way to restore a file pattern from the
afio backup files that Dobackup creates by default. It isn't particularily
pretty, but it works, and it's what we use. Until there's a "Dorestore"
command, there's not much else.

This process assumes you are using "Disk" or "Filesystem" mode for your
backups. If you use "Tape" mode, you will have to read the afio(1) and mt(1)
man pages for more details on reading backup files from tape.

You really ought to read the man page and be familiar with afio. It has a
lot of options that aren't covered here, and could save your butt if you
critically need a file restored and don't have these docs around.

Process:
--------

1) Login to the server on which you want to do the restore, as a user who has
   access to the backups (ex. root), then do something like this:

   # cd /tmp
   # mkdir restore_20011211
   # cd restore_20011211

2) Get a listing of the backup files (this is just an example):

   # ls -s /mnt/backups

        0 MEDIAUNIT=WD64
   519440 host_20011201_011500.full
     4796 host_20011202_014348.incr
     9020 host_20011203_011500.incr
    27840 host_20011204_011500.incr
     1348 host_20011205_011500.incr
     4788 host_20011206_011501.incr
    14972 host_20011207_011500.incr
    48340 host_20011208_011501.incr
    25356 host_20011209_011500.incr
    11092 host_20011210_011500.incr

3) "Normal" Incremental backup mode:

   To fully restore a set of files matching a desired pattern, you need to
   restore those files from the most recent full backup and all subsequent
   incremental backups up to the date of the files you want restored. In the
   above example, the last full backup is easily destinguished by A) it's
   large size, and B) it's date (in this case, the backup policy demands a
   full backup on the first day of each month). You should be familiar with
   your implemented backup policy to be able to quickly find the relevant
   backup files.

   Note: As of version 4.21, all "full" backup files are tagged with ".full"
   on the end of the archive name, and "normal" incremental files have
   ".incr" appended.

   "Timewarp" backup mode:

   In this mode, only two archives are required: The most recent full backup
   (".full"), and the most recent timewarp mode file (".warp") for the
   timeframe to which you want to restore.

   For example, these files might be selected:
   host_20011201_011500.full, and
   host_20011210_011500.warp


Example:
--------

Here is an example that restores everything under /etc:

1) First, restore the most recent full backup.

   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011201_011500.full

2) Then restore each of the subsequent incremental backups, in order, or
   just the most recent timewarp backup:

   # "Normal" mode

   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011202_014348.incr
   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011203_011500.incr
   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011204_011500.incr
   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011205_011500.incr
   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011206_011501.incr
   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011207_011500.incr
   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011208_011501.incr
   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011209_011500.incr
   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011210_011500.incr

   # "Timewarp" mode

   # afio -i -v -Z -y etc/\* /mnt/backup/host_20011210_011500.warp

   NOTE: The pattern (after -y) should NOT begin with a leading "/". Afio
   strips the leading "/" during backup. Recent versions of afio will ignore
   a leading "/" in your specified pattern, but earlier versions would NOT
   match if you included it. Just to be sure, leave it out.

3) The results of your restore will now be in /tmp/restore_20011211. Just
   copy the files to their original locations and you're done.
