9.2. Restoring Subscription Asset Manager

Warning

Restoring Subscription Asset Manager overwrites all existing data for the Subscription Asset Manager instance.
Be certain to restore the proper Subscription Asset Manager instance.

Important

This procedure assumes that the Subscription Asset Manager server is being restored on the same machine where it was previously installed and backed up.
If the Subscription Asset Manager instance is being restored on a different host, then that system must have the same configuration as the original system, including the same hostname and IP address.
All restore operations must be performed as root.
  1. Create a configuration file with the same options as the original instance using the file from the configuration backup, then run the katello-configure script.
    [root@server ~]# katello-configure --answer-file=/etc/katello/katello-configure.conf
  2. Open the directory containing the backup files. For example:
    [root@server ~]# cd backup/
  3. Check the database names. The default database names are katelloschema and candlepin. If the Subscription Asset Manager instance is not using the default names, then the custom values will be in the db_name parameters in the katello-configure.conf file.
    [root@server backup]# grep db_name /etc/katello/katello-configure.conf
  4. Stop all services prior to restoring the databases:
    [root@server backup]# katello-service stop
  5. Restore the system files by extracting the archived files and directories. For example:
    [root@server backup]# tar --selinux -xzvf config_files.tar.gz -C /
    [root@server backup]# tar --selinux -xzvf elastic_data.tar.gz -C /
  6. Drop the existing Subscription Asset Manager PostgreSQL databases if any exist:
    [root@server backup]# service postgresql start
    [root@server backup]# su postgres -c "dropdb katelloschema"
    [root@server backup]# su postgres -c "dropdb candlepin"
    If all the processes are not stopped first, then the database drop operation can return this error:
    database xxx is being accessed by other users
  7. As the postgres user, run the pg_restore command to restore the databases.
    [root@server backup]# su postgres -c "pg_restore -C -d postgres /backup/katello.dump"
    [root@server backup]# su postgres -c "pg_restore -C -d postgres /backup/candlepin.dump"
    For more info about PostgreSQL restore operations, see the pg_dump man page or the PostgreSQL documentation.
  8. Restart all Subscription Asset Manager processes:
    [root@server backup]# katello-service restart
  9. Verify that all services are responding properly by checking the /var/log/katello/production.log log file for errors and the /var/log/candlepin/audit.log file for denials.
    Attempt to ping the Subscription Asset Manager instance:
    [root@server backup]# katello -u admin -p admin ping
    --------------------------------------------------------------------------------
                                     Katello Status
    
    Status Service        Result Duration Message
    --------------------------------------------------------------------------------
    OK
    candlepin      OK     74ms
    candlepin_auth OK     38ms
    elasticsearch  OK     37ms
    katello_jobs   OK     39ms