Back Up the Controller with mysqldump

The mysqldump utility is a MySQL backup tool that is included with the Controller instance of MySQL.

While mysqldump is not recommended for use on large data tables, such as the Controller metric data tables, it is useful for backing up Controller metadata. Metadata defines the monitored domain for the Controller, including applications, business transactions, alert configurations, and so on.

The following instructions assume that the binary path for the Controller's MySQL instance is in the PATH variable. The path to the Controller's instance of MySQL must precede any other MySQL path on your system. This prevents conflicts with other database management systems on your machine, such as a MySQL instance included by default with Linux.

The database binary files for the Controller database are in <controller_home>/db/bin.

Warning: Before using mysqldump, first ensure that the Controller app server is stopped. If you attempt to run mysqldump while the app server is running, it will severely degrade the performance and stability of the Controller.

To use mysqldump, run the mysqldump executable, passing the root username, password, and output file. The executable is located in the following directory:

<controller_home>/db/bin

The command should be in the form:

mysqldump -u root -p<password> <ignore-table_statements> > /tmp/metadata_dump.sql

For a full example that shows which tables to exclude for a metadata backup, see the contents of the metadata backup script described in the next section.

Sample mysqldump Script

The following script illustrates how to use mysqldump to export Controller metadata while excluding runtime data tables by script.

Warning:

Backing up the Controller with a custom MySQL data directory location using mysqldump will result in an incomplete and unusable metadata dump. The default location for the Controller's MySQL data directory is appd_install_dir/db/data. If you do not see the data directory here then that means an alternate directory or mount point was selected and configured for your MySQL data directory.

To fix this issue:

  1. Examine <Controller Home>/db/db.cnf
    1. Locate the datadir parameter. It contains the path to the MySQL data directory on your Controller host.
  2. Edit the metadata backup script
    1. Replace $appd_install_dir/db/data with the datadir path you located in db.cnf

To use the script:

  1. Download the version appropriate for your operating system.
  2. Rename the file to remove the .txt extension.
  3. Modify the contents of the file as described in the script comments.