=head1 NAME

backup_restoredb - Restores a saved copy of the Backup Database

=head1 SYNOPSIS

=for html
<div class="synopsis">

B<backup restoredb> S<<< [B<-portoffset> <I<TC port offset>>] >>> [B<-localauth>]
    S<<< [B<-cell> <I<cell name>>] >>> [B<-help>]

B<backup res> S<<< [B<-p> <I<TC port offset>>] >>> [B<-l>] S<<< [B<-c> <I<cell name>>] >>>
    [B<-h>]

=for html
</div>

=head1 DESCRIPTION

The B<backup restoredb> command restores to the Backup Server machine's
local disk a version of the Backup Database previously written to tape by
using the B<backup savedb> command.

(If the C<FILE YES> instruction appears in the
F</usr/afs/backup/CFG_I<device_name>> file associated with the specified
port offset, then the B<backup restoredb> command restores data from the
backup data file listed for that port offset in the Tape Coordinator's
F</usr/afs/backup/tapeconfig> file, instead of from tape. For the sake of
clarity, the following text refers to tapes only, but the Backup System
handles backup data files in much the same way.)

The most common reason to run this command is to replace a corrupted or
otherwise damaged Backup Database; use the B<backup dbverify> command to
determine the database's status. The command can also be used to restore
records that were removed from the database when the B<-archive> argument
was included on a previous B<backup savedb> command.

The command completely overwrites the existing Backup Database records for
volume sets, Tape Coordinators, and the dump hierarchy with the
corresponding information from the saved version. It does not overwrite
existing dump records, but instead interleaves the records from the copy
being restored. If both the existing database (on the Backup Server
machine's disk) and the copy being restored include a record about the
same dump, the Backup System retains the one in the existing database.

The Tape Coordinator's default response to this command is to access the
first tape it needs by invoking the C<MOUNT> instruction in the local
F</usr/afs/backup/CFG_I<device_name>> file, or by prompting the backup
operator to insert the tape if there is no C<MOUNT> instruction. However,
if the C<AUTOQUERY NO> instruction appears in the F<CFG_I<device_name>>
file, or if the issuer of the B<butc> command included the B<-noautoquery>
flag, the Tape Coordinator instead expects the tape to be in the device
already. If it is not, or is the wrong tape, the Tape Coordinator invokes
the C<MOUNT> instruction or prompts the operator. It also invokes the
C<MOUNT> instruction or prompts for any additional tapes needed to
complete the restore operation; the backup operator must arrange to
provide them.

=head1 CAUTIONS

If the database is corrupted, do not attempt to restore a saved database
on top of it. Instead, use the instructions for repairing a corrupted
database in the I<IBM AFS Administration Guide> chapter about performing
backup operations.

=head1 OPTIONS

=over 4

=item B<-portoffset> <I<TC port offset>>

Specifies the port offset number of the Tape Coordinator handling the
tapes for this operation.

=item B<-localauth>

Constructs a server ticket using a key from the local
F</usr/afs/etc/KeyFile> file. The B<backup> command interpreter presents
it to the Backup Server, Volume Server and VL Server during mutual
authentication. Do not combine this flag with the B<-cell> argument. For
more details, see L<backup(8)>.

=item B<-cell> <I<cell name>>

Names the cell in which to run the command. Do not combine this argument
with the B<-localauth> flag. For more details, see L<backup(8)>.

=item B<-help>

Prints the online help for this command. All other valid options are
ignored.

=back

=head1 EXAMPLES

The following example shows the Backup Database being restored from the
Tape Coordinator with port offset 0:

   % backup restoredb

=head1 PRIVILEGE REQUIRED

The issuer must be listed in the F</usr/afs/etc/UserList> file on every
machine where the Backup Server is running, or must be logged onto a
server machine as the local superuser C<root> if the B<-localauth> flag is
included.

=head1 SEE ALSO

L<butc(5)>,
L<backup(8)>,
L<backup_dbverify(8)>,
L<backup_savedb(8)>,
L<butc(8)>

I<IBM AFS Administration Guide>

=head1 COPYRIGHT

IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.

This documentation is covered by the IBM Public License Version 1.0.  It was
converted from HTML to POD by software written by Chas Williams and Russ
Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
