Backing Up orcharhino

When and how to backup orcharhino is a question highly dependent on your individual usage and setup. ATIX AG recommends performing backups before and after upgrading orcharhino.

The default use case is for orcharhino installations to run on virtual machines, most commonly within a VMware virtualization environment. ATIX AG recommends using the snapshot functionality provided by the virtualization solution for backups in such a setup. ATIX AG recommends making a file based backup with your enterprise backup solution if you run orcharhino on bare metal hardware.

Backing Up orcharhino Server Running on a Virtual Machine

ATIX AG recommends creating snapshots as provided by your virtualization solution orcharhino Server is running on, for example using VMware’s vSphere client, and to backup those snapshots. Your orcharhino VM is ideally powered down before taking a snapshot. Only if powering down your orcharhino is operationally not possible, you may take a live snapshot that also retains the VM’s memory.

You should check if there are any long running tasks before taking the snapshot or stopping any services:

$ foreman-rake katello:upgrade_check

This ideally results in output as follows:

Checking for running tasks...
[SUCCESS] - There are 0 active tasks.
         You may proceed with the upgrade.

Newer snapshots will include lots of references to older snapshots. This can be inefficient and negatively affect system performance if too many snapshots are kept at the same time. ATIX AG recommends to limit the number of snapshots to no more than three. Consider deleting older snapshots after creating new ones.

Alternatively, you can also create a backup based on the snapshot functionality of LVM, which would include the following steps:

  1. Your enterprise backup solution triggers all pre backup tasks, which include -depending on your backup strategy- stopping all orcharhino services or powering down the orcharhino instance altogether.

  2. Create an LVM snapshot via your backup application. In case the VM is still running, create a snapshot of its memory, too.

  3. Restart all orcharhino services or restart your orcharhino instance.

  4. Create a block-based backup of the snapshot according to your general backup routine.

  5. Have the backup application delete the LVM snapshot.

Updating Repositories after reverting to a Snapshot

If you abort your orcharhino Server upgrade and revert to an earlier snapshot, you have to update the enabled repositories on your orcharhino Server. Run subscription-manager repos --disable="*" to disable all repositories. Run the command as output by /opt/orcharhino/maintain/repo_map/repolist.py -o My_orcharhino_Version --latest-os --sm-command to enable the proper repositories for your orcharhino Server. You can now use both yum update to update packages and orcharhino-installer, for example to install the Microsoft Azure plugin, on your orcharhino Server.

Backing Up orcharhino Server Running on Bare Metal

Backing up orcharhino running on bare metal strongly depends to how you backup bare metal machines running AlmaLinux 8, Oracle Linux 8, Red Hat Enterprise Linux 8, and Rocky Linux 8 in general. This part describes a general backup strategy using a file-based approach.

Depending on the size of the data to be backup up, orcharhino will be offline for a correspondingly long time. The required offline period depends largely on the performance of your hardware and backup infrastructure as well as the number and size of synchronized repositories. Note that there are also other valid ways to backup orcharhino, but remember to always backup your orcharhino instance in a consistent manner, which is usually achieved by stopping all orcharhino services.

Procedure
  1. Stop your orcharhino instance with a pre backup hook by your enterprise backup solution:

    $ orcharhino-maintain service stop
  2. Check if all orcharhino services have been stopped successfully:

    $ orcharhino-maintain service status
  3. Deactivate all cron jobs or similar which could potentially trigger orcharhino tasks with a pre backup hook by your enterprise backup solution. This is necessary as some tasks may alter databases on your orcharhino even though the orcharhino service itself is not running.

  4. Execute a file based backup with your enterprise backup solution.

    You must include all relevant paths of the operating system and any installed applications. These might vary from the standard paths depending on your environment.

    You must also include all relevant paths of the orcharhino. This can also vary depending on the setup, installed plugins, and running services.

    The following list will assume a basic configuration of your orcharhino.

    The .hammer directory has to be backed up as it contains configuration files for the Hammer CLI:

    /root/.hammer/

    The following directories including all subdirectories must be backed up to maintain consistency in case of expanding the orcharhino feature set in the future:

    /etc/
    /opt/
    /var/

    In case you do not want to backup the above mentioned directory structure, at least the following directories and subdirectories must be backed up for a fundamentally functioning orcharhino instance regardless of the operating system:

    /opt/orcharhino/
    /opt/theforeman/
    /opt/puppetlabs/
    /usr/bin/
    /usr/lib/
    /usr/sbin/
    /usr/share/

    ATIX AG recommends to always take a complete backup of all file systems of the orcharhino system without exceptions.

  5. Restart all orcharhino services with a post backup hook by your enterprise backup solution.

    $ orcharhino-maintain service start
  6. Verify that all orcharhino services have been started successfully:

    $ orcharhino-maintain service status

Restoring your orcharhino backup takes place according to your general approach regarding restoring bare metal AlmaLinux 8, Oracle Linux 8, Red Hat Enterprise Linux 8, and Rocky Linux 8 systems.

Backing Up orcharhino Server Using orcharhino-maintain

ATIX AG recommends using offline backups for production use because this is the only way to ensure data integrity of the backup.

You cannot fully restore your orcharhino Server or orcharhino Proxy from a backup without Pulp content.

To backup orcharhino Server or orcharhino Proxy, see Backing up orcharhino Server and orcharhino Proxy in Administering orcharhino.

Restoring orcharhino Server Using orcharhino-maintain

To restore orcharhino Server or orcharhino Proxy from backup, see Restoring orcharhino Server or orcharhino Proxy from a backup in Administering orcharhino.