Back up and restore the Satellite Server configuration and database.
Outcomes
Perform a full backup of a Satellite Server.
Locate and identify backup files.
Restore an operational Satellite Server from a backup.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start maintain-backup
Instructions
You must create a Satellite Server backup as part of a disaster recovery plan. The Satellite Server's Pulp package content that is stored in the file system was previously backed up in a regular system backup. You must back up only the Satellite configuration and database contents.
Log in to the satellite system as the student user and switch to the root user.
[student@workstation ~]$ssh satellite[student@satellite ~]$sudo -i[sudo] password for student:student[root@satellite ~]#
Create a backup of the Satellite Server configuration and database.
Create the /var/tmp/backup directory to store backup data.
[root@satellite ~]# mkdir /var/tmp/backupCreate an offline backup of the Satellite Server that excludes the Pulp content.
Note the name of the subdirectory that the backup command creates under the /var/tmp/backup directory.
[root@satellite ~]#satellite-maintain backup offline --skip-pulp-content \ /var/tmp/backup...output omitted... Do you want to proceed?, [y(yes), q(quit)]y...output omitted... Done with backup: 2022-07-25 06:15:51 -0400 **** BACKUP Complete, contents can be found in: /var/tmp/backup/satellite-backup-2022-07-25-06-13-04 ****
Explore the contents of the backup subdirectory from the previous command output. Your file name, size, and other attributes would differ from this example.
[root@satellite ~]#ls -l /var/tmp/backuptotal 0 drwxrwx---. 2 root postgres 120 Jul 25 06:15 satellite-backup-YYYY-MM-DD-HH-MM-SS[root@satellite ~]#du -sh /var/tmp/backup/satellite-backup-457M /var/tmp/backup/satellite-backup-YYYY-MM-DD-HH-MM-SSYYYY-MM-DD-HH-MM-SS[root@satellite ~]#ls -l /var/tmp/backup/satellite-backup-total 467508 -rw-r--r--. 1 root root 16121185 Jul 25 06:13 config_files.tar.gz -rw-r--r--. 1 root root 55390 Jul 25 06:13 metadata.yml -rw-r--r--. 1 root root 462548521 Jul 25 06:13 pgsql_data.tar.gzYYYY-MM-DD-HH-MM-SS
On Satellite Server, modify an object in the Satellite Server, so you can test for a successful Satellite Server restore.
Update the admin user description, and create a user called backtest.
These user changes are not in the backup from the previous step.
When you successfully restore that backup, these two user changes are overwritten.
Log in to the Satellite Server web UI, https://satellite.lab.example.com, as the admin user with redhat as the password.
Click → , and click the admin user link.
Modify the field to Modified admin user description.
Click .
Click . On the tab, enter the information for the following fields. Leave the other fields unchanged. Click .
| Field | Value |
|---|---|
backtest
| |
root@satellite.lab.example.com
| |
INTERNAL
| |
redhat
| |
redhat
|
Log out of the admin user.
Restore the Satellite Server to the previous state before you created the user changes. The restore process takes approximately 20 minutes.
In the terminal on the satellite system, restore the Satellite backup.
Provide the subdirectory name from the previous backup command output.
Wait for the restore to complete.
[root@satellite ~]#satellite-maintain restore \ /var/tmp/backup/satellite-backup-...output omitted... Do you want to proceed?, [y(yes), q(quit)]YYYY-MM-DD-HH-MM-SSy
When the restore is complete, verify that the Satellite Server is restored.
Log in to the Satellite Server web UI, https://satellite.lab.example.com, as the admin user with redhat as the password.
Verify that the restore is successful.
Click → .
The backtest user does not exist.
Select the admin user.
The field is restored to its original value.
To free space in your disk, remove the backup files.
[root@satellite ~]# rm -rf /var/tmp/backupReturn to the workstation system as the student user.
[root@satellite ~]#exitlogout [student@satellite ~]$exitlogout [student@workstation ~]$