Disaster Recovery Plan

Note

Having a full disaster recovery plan is something quite complicated. It must be tailored to exact requirements of each site, and thus can only be created by working closely with the decision makers and operational personnel of that data center. As a consequence, this paper will not provide a specific disaster recovery plan, but will present most of the elements involved in coming up with such a plan.

We specifically do not cover certain critical areas which are mostly “hardware” related such as power, A/C, flood prevention, multiple power sources, UPSes, telecommunications links, multiple telecommunications links, and preventing single point of failure.

Bacula Installation Disaster Recovery Plan

Design a backup strategy in case of disaster recovery (more information is available in the Items to Implement Before Production chapter).

  • Backup your Catalog and store the (bootstrap) file in a safe location.

  • Backup your DIR and SD configuration files (if you are using BWeb Management Suite, please backup the folder).

  • Backup the File Daemon private/public key pair and/or the master keys if Data Encryption is used for the Catalog backup.

As a best practice, document your backup design to provide a good overview and enhance the understanding of your backup infrastructure.

Test your tape library infrastructure using the btape utility.

Bacula Configuration and Backups Disaster Recovery Plan

Your Disaster Recovery plan should include Bacula configuration and backups. In order to do so, you can have off-site backups including your configuration.

The needs are simple, the backups (for example the last Full backups of your systems), the content of /opt/bacula/ect and the Catalog.

The backups can be copied or migrated using Copy/Migration Jobs from one site to a safe site using schedules.

If you are using tapes, you can remove a set of tapes after the Full backups and store them in an off-site vault.

The most important part of this plan is that the Catalog and the configuration files are kept together.

Example

This is an example which you need to adapt to your own system.

First, set up a job that will backup /opt/bacula/etc and your catalog dump.

We would advise to have all Bacula configuration (/opt/bacula/etc content) as well as the catalog backup in a dedicated pool to ease the process of recovery as the Job will not be mixed into numerous other Jobs. Catalog and configuration files are all you need for recovering your backup environment. We will split the backup in 2 parts to insure consistency of the Catalog data.

This way we set up a specific pool for our Bacula configuration and Catalog backup, 2 jobs per volume. Of course you can tweak this example to have more files backed up to build your own disaster recovery plan (eg. TLS keys etc.).

Here is an example of a Pool on hard drives backing up a disaster recovery Job

Pool {
  Name = "DisasterRecovery-pool"
  ActionOnPurge = Truncate
  AutoPrune = yes
  FileRetention = 7 days # Adjust to the schedule of the Disaster Recovery job
                         # here it is kept 7 days before recycling
  JobRetention = 7 days  # This is the minimum we want to keep our DR data safe
  LabelFormat = "Disaster-"
  PoolType = "Backup"
  Recycle = yes
  Storage = "OnDisk"
  MaximumVolumeJobs = 2  # Here we want to keep config files and dump on the same
                         # volume. Adjust here if you don't want 2 jobs per volume
  VolumeRetention = 8 days
  VolumeUseDuration = 20 hours # How long do you want  your volume available. No more
                               # than one day (because you will run on DR backup job
                               # per day, but not too short in case something goes
                               # wrong during the backup.
                               # Adjust here depending on your policy
  Maximum Volumes = 10  # 7 generations kept, one written, some spare
}

Here is an example Job and FileSet for Disaster Recovery backups

Fileset {
   Name = "DisasterRecovery-catalog-fs" # FileSet for the Catalog
   Include {
      Options {
         Signature = SHA1
      }
      File = /opt/bacula/working/bacula.sql # where the Bacula catalog dump goes
                                            # to be adjusted with your catalog
                                            # dump
   }
}

Fileset {
   Name = "DisasterRecovery-config-fs"  # FileSet for the Bacula Enterprise
                                        # configuration files
   Include {
      Options {
         Signature = SHA1
      }
      File = /opt/bacula/etc  # Director's config files
                              # you can add other files like keys,
                              # content of /etc, and other directories
                              # to make this FileSet more complete and
                              # adapted to your environment
   }
}

Job {
   Name = "DisasterRecovery-catalog-job"
   Type = "Backup"
   Client = "baculaServer"   # change to the name of the fd running on the Bacula DIR
   Fileset = "DisasterRecovery-catalog-fs"
   JobDefs = "Default-jd"
   Level = "Full"            # full backup is preferable
   Messages = "Standard"
   Pool = "DisasterRecovery-pool" # the pool we just defined to hold all the DR config
   Priority = 20 # Adjust this priority  to be the highest of the schedule
   Runscript {
      Command = "/opt/bacula/scripts/make_catalog_backup bacula bacula"
      RunsOnClient = no
      RunsWhen = Before
   }
   Runscript {
      Command = "/opt/bacula/scripts/delete_catalog_backup"
      RunsOnClient = no
      RunsWhen = After
   }
   Schedule = "NightAfterJobs"
   Storage = "OnDisk"
   WriteBootstrap = "/opt/bacula/bsr/catalog-backup.bsr"
}


Job {
   Name = "DisasterRecovery-config-job"
   Type = "Backup"
   Client = "baculaServer"   # change to the name of the fd running on the Bacula DIR
   Fileset = "DisasterRecovery-config-fs"
   JobDefs = "Default-jd"
   Level = "Full"  # full backup is preferable
   Messages = "Standard"
   Pool = "DisasterRecovery-pool" # the pool we just defined to hold your DR config
   Priority = 15 # Adjust if necessary. Must be lower than the catalog's one
   Schedule = "NightAfterJobs"
   Storage = "OnDisk"
   WriteBootstrap = "/opt/bacula/bsr/config-backup.bsr"
}

Here we set different priority for the 2 jobs to ensure that the job that backs up the catalog runs after the backup of the configuration file.

This way, in case of Disaster, you reinstall the same version of Bacula, then you just need to grab the last volume from the DisasterRecovery-pool and use bxtract to extract all its content. The 2 Jobs will contain the catalog and the config.

You need to re-inject the catalog dump in your database, copy the config files to /opt/bacula/etc/ and everything is back online. (Test with /opt/bacula/bin/bacula-dir -t -u bacula -g bacula before launching the daemons.)

Important

Test your Disaster Recovery procedure and document it.

Go back to the Disaster Recovery chapter.

Go back to the main Bacula Infrastructure Recovery page.