Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
documentation.suse.com / Documentação do SUSE Linux Enterprise Server / RMT Guide / Backing up an RMT server
Applies to SUSE Linux Enterprise Server 15 SP4

7 Backing up an RMT server

This chapter explains how to create a backup of your RMT server and how to restore from it.

7.1 Creating a backup

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.

  1. Change to the backup directory.

    # cd /mnt/backup
  2. 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.

    # mysqldump -u rmt -p rmt > rmt_backup.sql
  3. Optionally, create a copy of your mirrored data.

    # mkdir repos
    # rmt-cli export repos ./repos/

7.2 Restoring a backup

This procedure details how to restore your RMT server from a backup created in Section 7.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.

  1. Install and configure the RMT server as described in Chapter 2, RMT installation and configuration.

  2. Go to the backup directory.

    # cd /mnt/backup/
  3. Use mysql to remove the newly created database and import the data.

    # 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 changed
    MariaDB [rmt]> source rmt_backup.sql;
    MariaDB [rmt]> quit
  4. Optionally, import the exported repositories.

    # rmt-cli import repos ./repos/
  5. Synchronize your data and update your repositories.

    # rmt-cli sync
    # rmt-cli mirror