This chapter explains how to create a backup of your RMT server and how to restore it.
This procedure details how to create a full backup of your RMT
server. It is assumed that you have an external disk or network share
mounted in /mnt/backup
which serves as a target
for the backup.
Change to the backup directory.
root #
cd /mnt/backup
Create a file containing a dump of your SQL database. You need to
provide the password you set for the rmt
database user during the installation.
root #
mysqldump -u rmt -p rmt > rmt_backup.sql
Optionally, create a copy of your mirrored data.
root #
mkdir repos
root #
rmt-cli export repos ./repos/
This procedure details how to restore your RMT server from a backup
created in Section 6.1, “Creating a Backup”. It is assumed that
the backup is mounted in /mnt/backup
. It is also
assumed that you are restoring the server on a newly installed
SLES.
Install and configure the RMT server as described in Chapter 1, RMT Installation and Configuration.
Go to the backup directory.
root #
cd /mnt/backup/
Use mysql
to remove the newly created database
and import the data.
root #
mysql -u rmt -p
Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. [...]MariaDB [(none)]>
DROP DATABASE rmt;
Query OK, 14 rows affected (0.84 sec)MariaDB [(none)]>
CREATE DATABASE rmt;
Query OK, 1 row affected (0.00 sec)MariaDB [(none)]>
use rmt;
Database changedMariaDB [rmt]>
source rmt_backup.sql;
[...]MariaDB [rmt]>
quit
Optionally, import the exported repositories.
root #
rmt-cli import repos ./repos/
Synchronize your data and update your repositories.
root #
rmt-cli sync
root #
rmt-cli mirror