Show Table of Contents
Chapter 9. Managing Subscription Asset Manager Instances
This chapter covers basic maintenance tasks for Subscription Asset Manager instances, such as backing up and restoring data.
9.1. Backing up Subscription Asset Manager
There is no utility to back up all Subscription Asset Manager information. The configuration files must be saved manually, and the backend database data must be dumped to a backup file.
All backup operations must be performed as
root.
- Create the desired backup directory. In this example,
umaskis set so that the directory is created with the proper permissions. Then, the directory is added to thepostgressystem group because Subscription Asset Manager uses a PostgreSQL database as its backend.[root@server]# umask 0017 [root@server]# mkdir /backup [root@server]# chgrp postgres /backup
- Open the backup directory.
[root@server]# cd /backup
- Use
tarorzipto create an archive of all of the Subscription Asset Manager configuration files. For example:[root@server]# tar --selinux -czvf config_files.tar.gz \ /etc/katello \ /etc/elasticsearch \ /etc/candlepin \ /etc/gofer \ /etc/grinder \ /etc/pki/katello \ /etc/pki/pulp \ /etc/qpidd.conf \ /etc/sysconfig/katello \ /etc/sysconfig/elasticsearch \ /root/ssl-build \ /var/www/html/pub/*
- Create a separate archive for the Elastic Search directory.
[root@server]# tar --selinux -czvf elastic_data.tar.gz /var/lib/elasticsearch
- Back up all of the PostgreSQL databases. The default database names are
katelloschemaandcandlepin.If the Subscription Asset Manager instance is not using the default names, then the custom values will be in thedb_nameparameters in thekatello-configure.conffile.[root@server]# grep db_name /etc/katello/katello-configure.conf
Run thepg_dumpcommand for each database to create a backup. This can take several minutes, depending on the sizes of the databases.[root@server]# su postgres -c "pg_dump -Fc katelloschema > /backup/katello.dump" [root@server]# su postgres -c "pg_dump -Fc candlepin > /backup/candlepin.dump"
Thepostgresservice must be running for thepg_dumpcommand to work. If the service is not running, then the databases can be backed up by zipping or tarring the PostgreSQL data directory. For example:[root@server]# tar --selinux -czvf pgsql_data.tar.gz /var/lib/pgsql/data/
Simply archiving the entire directory backs up all databases. Since all of the databases are shut down, the data directory should only be archived during a maintenance period.For more information about PostgreSQL backups, consult thepg_dumpman page or the PostgreSQL documentation. - After running
pg_dump, check that the appropriate.dumpfiles have been created in the specified backup directory. For example:# ls /backup candlepin.dump config_files.tar.gz elastic_data.tar.gz katello.dump

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.