Skip navigation
Currently Being Moderated

14.6 Backup and Recovery

VERSION 3  Click to view document history
Created on: Oct 11, 2011 4:59 PM by Zenoss API - Last Modified:  Oct 11, 2011 5:17 PM by Zenoss API

 6. Backup and Recovery

In some situations, you might want to back up configuration information and data from a  Resource Manager instance, and then later restore that instance. You might do this periodically, to take regular "snapshots" of your instance to archive; or infrequently, such as to move data from one instance to another, or to restore a setup after performing a fresh installation.  Resource Manager provides tools that enable you to manage these backup and restore tasks.

With backup and restore, the system includes:

  • Events database

  • Zope database, which includes all devices, users, and event mappings

  • $ZENHOME/etc directory, which contains configuration files for the system daemons

  • $ZENHOME/perf directory, which contains performance data

Suggestions for a successful backup and restore experience:

  • If you have the available disk space, tar and zip $ZENHOME before starting any backup or restore operation.

  • Make sure the system, including all daemons, is stopped before performing a restore operation.

  • Avoid using these tools to go from a newer version of  Resource Manager to an older version.

  • If you use these tools to go from an older version to a newer version, you should run zenmigrate after the restore operation.

  • If restoring to a different  Resource Manager installation (one that differs from the backup version), make sure file paths in the $ZENHOME/etc/*.conf files are appropriate for the new environment after you restore.

The following sections describe backup and restore scripts, as well as options for controlling their behavior.

 6.1. Backup (zenbackup)

The backup script is $ZENHOME/bin/zenbackup. Typical use of zenbackup looks like:

> zenbackup --file=BACKUPFILEPATH

If the system is running then you can run zenbackup without any arguments. A backup file will be placed in $ZENHOME/backups.

 6.1.1. Backup Options

The following table lists frequently used zenbackup options.

Note

Use the zenbackup --help command to see a complete list of zenbackup options.

 OptionDescription 
dont-fetch-argsThis instructs zenbackup not to attempt to get values for zepdbhost, zepdbport, zepdbname, zepdbuser, and zepdbpass from $ZENHOME/etc/zeneventserver.conf. You must specify the options manually to access the events database.
--file=FilenameUse --file to specify a location for the backup file. By default it will be named zenoss_Date.tgz and placed in $ZENHOME/backups.
no-perfdataDisables saving performance data in the backup.
no-zodbDisables saving the ZODB database and installed ZenPacks in the backup.
--stdoutThis flag tells zenbackup to send the backup information to standard output instead of to a file. Incompatible with --verbose.
--no-save-mysql-accessThis instructs zenbackup not to save host, port, mysqluser, mysqlpassword, mysqldb, zepdbhost, zepdbport, zepdbuser, zepdbpass, and zepdbname as part of the backup file. Use this to prevent your backup files from containing a MySQL user name and password.
--no-eventsdbDo not include the events database as part of the backup.
-v, --verbosePrint progress messages. Incompatible with --stdout.

 6.1.2. Create a Backup

To back up your system instance from the interface:

  1. From the Navigation menu, select Advanced.

    The Settings page appears.

  2. In the left panel, select Backups.

    The Backups page appears.

     

    Figure 14.3. Backup

    Backup

  3. In the Create New Backup area, enter information or make selections for the backup. Options available are a subset of those available from the zenbackup command line tool.

  4. Click Create Backup.

 6.1.3. Delete a Backup

To delete a backup from the interface:

  1. From the Navigation menu, select Advanced > Settings.

  2. In the left panel, select Backups.

    The Backups page appears. The Backups area lists all backup files in $ZENHOME/backups.

  3. Select one or more files in the list, and then select Delete Backup from the Action menu.

  4. Click Delete in the Delete Backup dialog to confirm the action.

Note

Backup files can become large as your databases grow, so you may want to limit the number of backups you keep if drive space becomes an issue.

 6.1.4. Remote Backups

Keeping backups on your server should help you recover if one of your databases becomes corrupt or your configuration becomes problematic. However, you should keep at least one recent backup file on a different server (ideally at a different physical location) in case a physical disk fails.

 6.2. Restore (zenrestore)

The restore script is $ZENHOME/bin/zenrestore. Typical use of zenrestore looks like:

> zenrestore --file=BACKUPFILEPATH

 6.2.1. Restore Options

The following table lists frequently used zenrestore options.

Note

Use the zenrestore --help command to see a complete list of zenrestore options.

 OptionDescription 
--fileThis is a backup file created with zenbackup You must specify either --file or --dir.
--dirThe path to an unzipped backup file. You must specify either --file or --dir.
--no-eventsdbDo not restore the events database. If the backup file does not contain MySQL events data then zenrestore will not modify your events database even if you do not specify --no-eventsdb.
no-perfdataDisables saving performance data in the backup.
no-zodbDisables saving the ZODB database and installed ZenPacks in the backup.
-v, --verbosePrint progress messages.
Comments (0)