Backup and Restore
This chapter contains information on the files you need to back up.
With the built-in backup and restore solution (mgradm backup
) you create SUSE Manager backups.
Information about restoring from your backups in the case of a system failure completes this chapter.
Because SUSE Manager relies on a database as well as the installed program and configurations, it is important to back up all components of your installation.
Back up your SUSE Manager installation regularly to prevent data loss and enable quick recovery.
Regardless of the backup method you use, you must have available at least three times the amount of space your current installation uses. Running out of space can result in backups failing, so check this often. |
1. Disable old method with smdba
Skip this section if you installed SUSE Manager 5.0 from scratch.
With the advent of the built-in solution, the old method with the |
Either disable smdba
before migrating (recommended) or later on the migrated SUSE Manager 5.0 system.
This procedure only works when smdba is still installed.
+
This will change archive_command
in /var/lib/pgsql/data/postgresql.conf
as follows:
archive_command = '/bin/true'
Now your old system is ready to be migrated to SUSE Manager 5.0.
Use this procedure after migration, when smdba is no longer available.
-
On the container host, as root, edit
/var/lib/containers/storage/volumes/var-pgsql/_data/postgresql.conf
and set these options:archive_mode = off archive_command = '/bin/true'
-
Restart the container:
mgradm restart
2. Back up SUSE Manager
The most comprehensive method for backing up your SUSE Manager installation is to use mgradm backup create
command.
This can save you time in administering your backup, and can be faster to reinstall and re-synchronize in the case of failure.
However, this method requires significant disk space and could take a long time to perform the backup.
mgradm backup create
command performs backup to a directory.
This directory can be both local or mounted remote storage.
mgradm backup create
command allows various customizations of the content of the backup.
For all available options, see mgradm backup create --help
.
2.1. Full Backup of SUSE Manager
A full backup of the SUSE Manager consists of backing up the following components:
-
SUSE Manager volumes
-
database volumes
-
podman network configuration
-
podman secrets
-
SUSE Manager systemd services
-
SUSE Manager container images
The SUSE Manager service is automatically stopped during creation of a full backup. |
mgradm backup create
-
On the container host, as root, create backup with:
mgradm backup create $path
Replace
$path
by the path to the backup location.
2.2. Partial Backup of SUSE Manager
mgradm backup create
tool allows creating partial backups.
It is possible to skip individual or all volumes, skip database backup and images.
Particularly when database backup is skipped, backup is created without stopping SUSE Manager services and can act as a one phase in two phase backup procedure.
Partial backup cannot guarantee backup/restore consistency. |
-
On the container host, as root, create backup with:
mgradm backup create --skipdatabase $path
Replace
$path
by the path to the backup location.
-
On the container host, as root, create backup with:
mgradm backup create --skipvolumes $volumes $path
Replace
$path
by the path to the backup location.Replace
$volumes
by the name of the volume name to be included in the backup, or by a comma separated list of volumes to be included.Use
all
to skip all volumes, except database volumes.
2.3. Backing up extra volumes
mgradm backup
command uses internal list of SUSE Manager volumes.
If additional volumes were configured during the installation, or additional volumes should be added to the backup, they need to be specified using --extravolumes $volumes
.
-
On the container host, as root, create backup with:
mgradm backup create --extravolumes $volume $path
Replace
$path
by the path to the backup location.Replace
$volumes
by the name of the volume name to be included in the backup. or by a comma separated list of volumes to be included.
2.4. Perform a Manual Database Backup
-
Allocate permanent storage space for your backup.
-
At the command prompt of the SUSE Manager container host, as root, use:
mgradm backup create --skipvolumes all --skipconfig --skipimages $path
3. Restore SUSE Manager from the Existing Backup
Restoring SUSE Manager from the existing backup will enumerate backup for volumes, images and configuration to restore. Unlike in backup create scenario, restore operation is not using an internal volume list, but automatically detect every volume or image present in the backup.
After the list of items to restore is gathered, presence and integrity check is performed. Presence check ensures backup restore will not accidentally overwrite existing volumes, image or configurations. Integrity check is done by computing backup items checksums.
After both checks are successful, actual backup restore is performed.
SUSE Manager services are not automatically started after backup restore is finished. |
-
On the container host, as root, re-deploy the SUSE Manager Server with:
mgradm backup restore $path mgradm start
Replace
$path
by the path to the backup location.
Verification of the backup can be a time-consuming operation. If backup integrity is ensured by other means, verification can be skipped by using --skipverify
option.
If for some reason it is needed to skip restoring a volume present in the backup, --skipvolumes $volumes
option can be used.
3.1. Recommended Steps after Restoring a Backup
-
Re-synchronize your SUSE Manager repositories using either the SUSE Manager Web UI, or with the
mgr-sync
tool at the command prompt in the container. You can choose to re-register your product, or skip the registration and SSL certificate generation sections. -
On the container host, check whether you need to restore
/var/lib/containers/storage/volumes/var-spacewalk/_data/packages/
. If/var/lib/containers/storage/volumes/var-spacewalk/_data/packages/
was not in your backup, you need to restore it. If the source repository is available, you can restore`/var/lib/containers/storage/volumes/var-spacewalk/_data/packages/
with a complete channel synchronization:mgrctl exec -ti -- mgr-sync refresh --refresh-channels
-
Schedule the re-creation of search indexes next time the
rhn-search
service is started. This command produces only debug messages, it does not produce error messages. On the container host, enter:mgrctl exec -ti -- rhn-search cleanindex