Chapter 2. Cloning Satellite Server You can clone the Satellite Server to create instances for trying out upgrades and the migration of instances to a different machine or operating system. This is an optional step to provide more flexibility during the upgrade. Note The created instances are not supposed to run in parallel in a production environment. You must decommission any testing instances after completing the tests or any old instances after completing the migration. Use the following procedures to clone your Satellite instances to preserve your environments in preparation for upgrade. The Satellite clone tool does not support migrating a Capsule Server to Red Hat Enterprise Linux 7. Instead you must backup the existing Capsule Server, restore it on Red Hat Enterprise Linux 7, then reconfigure Capsule Server. 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. Restart goferd in Content hosts and Capsules to refresh the connection. 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 7 to become the target server. Do not install Red Hat Enterprise Linux 7 software groups, or third-party applications. Ensure that your server complies with all the specifications of Preparing your Environment for Installation in Installing Satellite Server . A backup from Satellite 6.10 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 the capacity to store all your backup files from 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: Verify the Pool ID of your Satellite subscription: Note the Pool ID for later use. Remove the Red Hat Satellite subscription: 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. Enter the following commands to register to the Customer Portal, attach subscriptions, and enable only the required subscriptions: 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 . Enable remote execution: Log on 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 , then click Manage Manifest . Click the Refresh button, 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 a Satellite or Capsule Server in Administrating 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 in Red Hat Satellite . 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
subscription-manager list --consumed --matches 'Red Hat Satellite'|grep " Pool ID :"|awk '{print USD3}'
subscription-manager remove --serial=USD(subscription-manager list --consumed --matches 'Red Hat Satellite'|grep "Serial:"|awk '{print USD2}')
du -sh /var/lib/pulp/
satellite-maintain backup offline --assumeyes /var/backup
satellite-maintain service stop satellite-maintain service disable
subscription-manager register your_customer_portal_credentials subscription-manager attach --pool= pool_ID subscription-manager repos --disable=* subscription-manager repos --enable=rhel-7-server-rpms --enable=rhel-server-rhscl-7-rpms --enable=rhel-7-server-satellite-maintenance-6-rpms --enable=rhel-7-server-ansible-2.9-rpms --enable=rhel-7-server-satellite-6.10-rpms
yum install satellite-clone
satellite-clone
satellite-installer --scenario satellite --enable-foreman-plugin-remote-execution --enable-foreman-proxy-plugin-remote-execution-ssh