Search

Chapter 12. Backing up and restoring Red Hat Update Infrastructure

download PDF

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. Backing up Red Hat Update Appliance Database

Procedure

  1. Change to the postgres user:

    # su - postgres
  2. Dump the PostgreSQL database:

    # pg_dump -j 4 -F d -f <pg_dump_directory> pulp
Note

The arguments used with the pg_dump command are as follows:
-j 4: Instructs pg_dump to run using 4 parallel threads.
-F d: Instructs pg_dump to select a directory-format archive as the format of the output.
<pg_dump_directory>: The path the directory where pg_dump output will be written.
pulp: Is the name of the database.

Important

The postgres user must be able to create and write to the pg_dump_directory and there must be enough disk space. For reference, the dump of a very large database configured with about 600 repositories takes approximately 25 GB.

Important

This operation can take a lot of time. For reference, our example of the database with 600 repositores could take up to 5 hours.

12.3. 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.4. Restoring Red Hat Update Appliance Database

Procedure

  1. Change to the postgres user:

    # su - postgres
  2. Restore the PostgreSQL database:

    # pg_restore -j 4 -F d -d pulp <pg_dump_directory>
Note

The arguments used with the pg_restore command are as follows:
-j 4: Instructs pg_restore to run using 4 parallel threads.
-F d: Instructs pg_restore to select a directory-format archive as the format of the input.
-d pulp: Instructs pg_restore to use the database names pulp.
<pg_dump_directory>: The path the directory where pg_dump output will be read from.

Important

The postgres user must be able to read the pg_dump_directory.

Important

This operation can take a lot of time. For reference, our example of the database with 600 repositores could take up to 5 hours.

12.5. 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.6. 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.7. 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.8. 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.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.