Backing up and restoring BSUS data - Adaptive Applications - BlueCat Gateway - 25.2

BlueCat Server Update Services Administration Guide

ft:locale
en-US
Product name
BlueCat Gateway
Version
25.2

The installation of BlueCat Server Update Services (BSUS) comes with a backup and restore Python script that you can use to back up the contents of your BSUS containers, then restore them to the same (or a different) BSUS host later. You can run this script as part of an automated backup mechanism in case of a catastrophic hardware or software failure. This script is located in the BSUS container as:

data_backup_restore.py
Note: While applying a product upgrade to the BSUS application itself from a very old BSUS version (prior to BSUS v23.1), you will use a different backup script, backup_jobs.sh. This is not the same as the script described here.
Important: This script is intended to back up and restore data only between identical versions of BSUS. To determine the BSUS version, look at the generated name of the backup file, such as /home/bluecat/bsus232-qa/bsus_23.2.1248_2023-07-26_10-03-29.tgz. You can also view the contents of the file volume/manifest.txt.

Backup script setup

This script uses the open source package Busybox, a collection of common UNIX/Linux utilities. If Busybox is not already present ony your system and BSUS can access the internet, the script will attempt to retrieve it from the Docker Hub website.

If BSUS cannot access the internet, you must manually download the Busybox image, save it to an archive store, then load it into the local image store on the BSUS host. Commands that will do so are as follows:

  1. Before downloading Busybox, on a system with both docker and internet access, check whether the busybox image is already present.

    sudo docker image ls

    If the Busybox image is not present, continue with the steps below.

  2. Pull the Busybox image from the Docker Hub website:

    sudo docker pull busybox
  3. Save the Busybox image as a tar file:

    sudo docker save --output busybox.tar busybox
  4. (Optional) Clean up the folder by removing the downloaded busybox image. This is useful if you're testing this process on a separate machine.

    sudo docker image rm busybox
  5. Copy the tar file to the BSUS host.

  6. Load the tar file into docker:

    sudo docker load --input busybox.tar
  7. Confirm that the Busybox image is present:

    sudo docker image ls
    Tip: Look for a line that lists the Busybox image, with a creation date of today and a size of approximately 4.26 MB.

Backing up BSUS data with the data_backup_restore.py script

When backing up BSUS data, you'll send the backup command to the data_backup_restore.py script. The script will create a GZIP compressed tar archive file (a tgz file). You can either run the script manually, or execute it as part of an automated process. If desired, you can specify a name and path for the backup file.

To create a backup with a default name for the backup file:

  • Run the following command:

    python3 data_backup_restore.py backup

To create a backup with a specific name for the backup file:

  • Run the following command:

    python3 data_backup_restore.py backup -f="<path and filename>"

    The script will automatically append the file name extension .tgz to your filename. For example, if the path and filename are /home/ubuntu/Downloads/mybackup, the script will create a file named mybackup.tgz in the /home/ubuntu/Downloads/ folder.

Restoring up BSUS data with the data_backup_restore.py script

When restoring backed up data, you'll send the restore command to the data_backup_restore.py script.

To restore jobs from a backup file:

  • Run the following command:

    python3 data_backup_restore.py restore -f="<path and filename>