Chapter 12. Backing up and restoring Red Hat Update Infrastructure

After you have installed and configured your Red Hat Update Infrastructure(RHUI) servers, you might want to back them up. Backing up RHUI is useful if you encounter any problems or do not configure RHUI correctly. In such cases, you can return to a previous working configuration by restoring RHUI.

To successfully back up RHUI, you must back up all of your RHUA, CDS, and HAProxy nodes.

12.1. Backing up Red Hat Update Appliance

To back up Red Hat Update Appliance, you must back up all the associated files and storage.

Note

To back up RHUA, you must stop the associated services. However, stopping services does not disable any client instances from updating or installing packages because clients are connected only to the content delivery servers (CDSs). Consequently, If you have an automated monitoring solution in place, your monitoring may fail during the backup process.

Procedure

  1. Stop pulp-server services:

    # systemctl stop pulpcore-api pulpcore-content pulpcore-worker\*
  2. Verify whether the services have stopped:

    # systemctl status pulpcore-api pulpcore-content pulpcore-worker\*
  3. Back up the following files.

    # cp -a <source_files_path> <destination_files_path>
    Important

    Ensure that the files retain their current attributes when you back them up.

    List of Files:

    • /etc/pki/rhui/*
    • /etc/pulp/*
    • /etc/rhui/*
    • /etc/rhui/rhui-tools.conf
    • /etc/nginx/*
    • /root/.rhui/*
    • /var/log/rhui/*
    • /var/log/rhui-subscription-sync.log*
    • Optional: /var/lib/rhui/*

      Note

      Backing up this directory backs up all of the downloaded content, which might be a large amount of data.

  4. Back up any generated client entitlement certificates and client configuration RPMs.
  5. Restart RHUI services

    # rhui-services-restart

12.2. Restoring Red Hat Update Appliance

To restore RHUA, you must create a new RHUA node and replace the associated files with the backed up versions.

Procedure

  1. Create a new RHUA node. For more information, see Setting up RHUA nodes.
  2. Stop pulp-server services:

    # systemctl stop pulpcore-api pulpcore-content pulpcore-worker\*
  3. Verify whether the services have stopped:

    # systemctl status pulpcore-api pulpcore-content pulpcore-worker\*
  4. Restore the following files.

    # cp -a <source_files_path> <destination_files_path>
    Important

    Ensure that the files retain their current attributes when you restore them.

    List of Files:

    • /etc/pki/rhui/*
    • /etc/pulp/*
    • /etc/rhui/*
    • /etc/rhui/rhui-tools.conf
    • /etc/nginx/*
    • /root/.rhui/*
    • /var/log/rhui/*
    • /var/log/rhui-subscription-sync.log*
    • Optional: /var/lib/rhui/*

      Note

      Restoring this directory restores all of the downloaded content, which might be a large amount of data.

  5. Restore any generated client entitlement certificates and client configuration RPMs.
  6. Restart RHUI services

    # rhui-services-restart

12.3. Backing up content delivery servers

To back up CDSs, you must back up all the associated files and storage.

Note

To avoid complete loss of service, back up a single CDS node at a time. Clients will automatically switch to other running CDS nodes.

Procedure

  1. Stop the nginx service:

    # systemctl stop nginx
  2. Verify that the nginx service has stopped:

    # systemctl status nginx
  3. Back up the following files.

    # cp -a <source_files_path> <destination_files_path>
    Important

    Ensure that the files retain their current attributes when you back them up.

    List of files:

    • /etc/nginx/*
    • /var/log/nginx/*
    • /etc/pki/rhui/*
  4. Restart RHUI services.

    # rhui-services-restart

12.4. Restoring content delivery servers

To restore content delivery servers, you must create a new CDS node and replace the associated files with the backed up versions.

Procedure

  1. Create a new CDS node. For more information, see Setting up CDS nodes.
  2. Stop the nginx service:

    # systemctl stop nginx
  3. Verify that the nginx service has stopped:

    # systemctl status nginx
  4. Restore the following files.

    # cp -a <source_files_path> <destination_files_path>
    Important

    Ensure that the files retain their current attributes when you restore them.

    List of files:

    • /etc/nginx/*
    • /var/log/nginx/*
    • /etc/pki/rhui/*
  5. Restart RHUI services.

    # rhui-services-restart

12.5. Backing up HAProxy servers

To back up HAProxy servers, you must back up all the associated files and storage.

Procedure

  1. Back up the /etc/haproxy/haproxy.cfg file.

    # cp -a <source_files_path> <destination_files_path>
    Important

    Ensure that the file retains its current attributes when you back it up.

12.6. Restoring HAProxy servers

To restore HAProxy servers, you must create a new HAProxy node and replace the associated files with the backed up versions.

Procedure

  1. Create a new HAProxy node. For more information, see Setting up HAProxy nodes.
  2. Restore the /etc/haproxy/haproxy.cfg file.

    # cp -a <source_files_path> <destination_files_path>
    Important

    Ensure that the file retains its current attributes when you restore it.