Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
documentation.suse.com / SUSE Linux Enterprise Serverマニュアル / RMT Guide / Backing Up an RMT Server
Applies to SUSE Linux Enterprise Server 15 SP2

6 Backing Up an RMT Server

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

6.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/

6.2 Restoring a Backup

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.

  1. Install and configure the RMT server as described in Chapter 1, 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