After every batch of backups, Bacula runs the BackupCatalog job, which saves a backup of the backup database. This page gives a quick overview of how to recover the database from this backup, in the event the Director loses its database. It's not a full procedure, but it should be enough to point in the right direction.
To solve the chicken-and-egg problem of recovering a backup without a functioning bacula director, we need to use bextract to extract the database file. This is most easily done if you have the bootstrap file from the catalog backup; if the director's filesystem is still intact (other than the database being blown) you should find it in
/var/lib/bacula/BackupCatalog.bsr
.
Copy this file to russell.math.ucsb.edu, where the actual backup volumes for the pool used by this backup are stored.
On russell, run sudo bextract -b BackupCatalog.bsr DataCenter-1 /destination-directory
. "destination-directory" should have enough free space for the entire catalog database dump; at present this is about 10 GB.
You should end up with var/lib/bacula/bacula.sql under the destination directory. This is an ASCII SQL dump and will compress nearly 10:1, so it pays to compress it with gzip before moving it.
Now, move bacula.sql.gz to the director (lovelace, as things currently are set up.) Create a bacula user and database as described in the Bacula documentation, but don't initialize it yet. Now load the database dump using something like gunzip -c bacula.sql.gz | sudo -u bacula psql
.
You should now have a working bacula database again, and you can proceed to run restores as you normally would for any remaining computers that need recovering.
Edit • Attach • Print version • History: r1 • Backlinks • View wiki text • Edit wiki text • More topic actions