Chapter 2. Cloning Satellite Server You can clone your Satellite Server to create instances to test upgrades and migration of instances to a different machine or operating system. This is an optional step to provide more flexibility during the upgrade or migration. You cannot use the Satellite clone tool on a Capsule Server. Instead, you must backup the existing Capsule Server, restore it on the target server, and then reconfigure Capsule Server. Note If you create a new instance of the Satellite Server, decommission the old instances after restoring the backup. Cloned instances are not supposed to run in parallel in a production environment. Terminology Ensure that you understand the following terms: Source server The origin of the clone. Target server The new server that you copy files to and clone the source server to. 2.1. Cloning process overview Back up the source server. Clone the source server to the target server. Power off the source server. Update the network configuration on the target server to match the target server's IP address with its new host name. Test the new target server. 2.2. Prerequisites To clone Satellite Server, ensure that you have the following resources available: A minimal install of Red Hat Enterprise Linux 8 to become the target server. Do not install Red Hat Enterprise Linux 8 software groups or third-party applications. Ensure that your server complies with all the required specifications. For more information, see Preparing your Environment for Installation in Installing Satellite Server in a connected network environment . A backup of your Satellite Server that you make using the satellite-maintain backup script. You can use a backup with or without Pulp data. A Satellite subscription for the target server. Before you begin cloning, ensure the following conditions exist: The target server is on an isolated network. This avoids unwanted communication with Capsule Servers and hosts. The target server has at least the same storage capacity as the source server. Customized configuration files If you have any customized configurations on your source server that are not managed by the satellite-installer tool or Satellite backup process, you must manually back up these files. 2.3. Pulp data considerations You can clone Satellite server without including Pulp data. However, for your cloned environment to work, you do require Pulp data. If the target server does not have Pulp data, it is not a fully working Satellite. To transfer Pulp data to a target server, you have two options: Clone using backup with Pulp data Clone using backup without Pulp data and copy /var/lib/pulp manually from the source server. If your pulp_data.tar file is greater than 500 GB, or if you use a slow storage system, such as NFS, and your pulp_data.tar file is greater than 100 GB, do not include pulp_data.tar in the backup because this can cause memory errors during extraction. Copy the pulp_data.tar file from the source server to the target server. To back up without Pulp data Follow the steps in the procedure in Section 2.4, "Cloning Satellite Server" and replace the steps that involve cloning with Pulp data with the following steps: Perform a backup with PostgreSQL databases active excluding the Pulp data: Stop and disable Satellite services: Copy the Pulp data to the target server: Proceed to Section 2.4.2, "Cloning to the target server" . 2.4. Cloning Satellite Server Use the following procedures to clone Satellite Server. Note that because of the high volume of data that you must copy and transfer as part of these procedures, it can take a significant amount of time to complete. 2.4.1. Preparing the source server for cloning On the source server, complete the following steps: Determine the size of the Pulp data: If you have less than 500 GB of Pulp data, perform a backup with PostgreSQL databases active including the Pulp data. If you have more than 500 GB of Pulp data, skip the following steps and complete the steps in Section 2.3, "Pulp data considerations" before you continue. Stop and disable Satellite services: Proceed to Section 2.4.2, "Cloning to the target server" . 2.4.2. Cloning to the target server To clone your server, complete the following steps on your target server: The satellite-clone tool defaults to using /backup/ as the backup folder. If you copy to a different folder, update the backup_dir variable in the /etc/satellite-clone/satellite-clone-vars.yml file. Place the backup files from the source Satellite in the /backup/ folder on the target server. You can either mount the shared storage or copy the backup files to the /backup/ folder on the target server. Power off the source server. Register your instance to the Red Hat Customer Portal and enable only the required repositories: If the target server runs Red Hat Enterprise Linux 9, enter the following commands: If the target server runs Red Hat Enterprise Linux 8, enter the following commands: Install the satellite-clone package: After you install the satellite-clone tool, you can adjust any configuration to suit your own deployment in the /etc/satellite-clone/satellite-clone-vars.yml file. Run the satellite-clone tool: Reconfigure DHCP, DNS, TFTP, and remote execution services. The cloning process disables these services on the target Satellite Server to avoid conflict with the source Satellite Server. Reconfigure and enable DHCP, DNS, and TFTP in the Satellite web UI. For more information, see Configuring External Services on Satellite Server in Installing Satellite Server in a connected network environment . Log in to the Satellite web UI, with the username admin and the password changeme . Immediately update the admin password to secure credentials. Ensure that the correct organization is selected. In the Satellite web UI, navigate to Content > Subscriptions . Click Manage Manifest . Click Refresh and then click Close to return to the list of subscriptions. Verify that the available subscriptions are correct. Follow the instructions in the /usr/share/satellite-clone/logs/reassociate_capsules.txt file to restore the associations between Capsules and their lifecycle environments. Update your network configuration, for example, DNS, to match the target server's IP address with its new host name. The satellite-clone tool changes the host name to the source server's host name. If you want to change the host name to something different, you can use the satellite-change-hostname tool. For more information, see Renaming Satellite Server in Administering Red Hat Satellite . If the source server uses the virt-who daemon, install and configure it on the target server. Copy all the virt-who configuration files in the /etc/virt-who.d/ directory from the source server to the same directory on the target server. For more information, see Configuring virtual machine subscriptions . After you perform an upgrade using the following chapters, you can safely decommission the source server.

Commands:
satellite-maintain backup offline --skip-pulp-content --assumeyes /var/backup
satellite-maintain service stop satellite-maintain service disable
rsync --archive --partial --progress --compress /var/lib/pulp/ target_server.example.com:/var/lib/pulp/
du -sh /var/lib/pulp/
satellite-maintain backup offline --assumeyes /var/backup
satellite-maintain service stop satellite-maintain service disable
subscription-manager register subscription-manager repos --disable=* subscription-manager repos --enable=rhel-9-for-x86_64-appstream-rpms --enable=rhel-9-for-x86_64-baseos-rpms --enable=satellite-maintenance-6.16-for-rhel-9-x86_64-rpms
subscription-manager register subscription-manager repos --disable=* subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms --enable=rhel-8-for-x86_64-baseos-rpms --enable=satellite-maintenance-6.16-for-rhel-8-x86_64-rpms dnf module enable satellite-maintenance:el8
dnf install satellite-clone
satellite-clone