Data Backup and Restoration

 

Periodically backing up the database is very essential, as it helps you restore OpManager service back during planned maintenance as well as unplanned mishaps. OpManager database contains two types of data:

Performance data: This is the data gathered by OpManager by periodically polling or querying the resources on a monitored device to determine its performance. This includes resources like CPU, Memory, Response time, Traffic etc.

Configuration data: There are quite a few configurations an administrator effects in OpManager for easy management and monitoring. The configurations include user settings, details of discovered devices, custom monitors, threshold settings, notification profiles, etc. Most configuration data is persisted in the database while a few configurations are written in conf files.  So when you backup configuration data, you must take care to back up the ones you need.



Backup & restoration steps for OpManager build 9450 and above


Backup

Following table lists the backup utilities bundled with OpManager and their purpose. Make sure you use the one that fits your backup need:

S.No
Utility
Path
Database
Purpose
1

BackupDB_Mysql.bat/sh


Arguments: mode, destination, exclude, threads


mode*: Backs up either both performance and configuration data or configuration data alone
possible values: all, configdata ('all' backs up both performance and configuration data while 'configdata' backs up configuration data alone)


destination: This option is used to store the backup file in different location. By default it will be stored in <OpManager Home/backup> directory.


exclude: Allows you to exclude netflow and ncm plugin data while taking backup
possible values: ncm, netflow


threads: Increasing the number of threads will increase the backup speed. Default thread count is 10, but you can increase up to 15.


Examples:

  • BackupDB_Mysql.bat -mode all -exclude ncm
  • BackupDB_Mysql.bat -mode configdata -threads 12 -destination c:\manageengine

*- Mandatory field


OpManager Home>/bin /backup

MySQL
This utility does a backup of the complete database, viz., performance and configuration data.

If you are using MySQL bundled with OpManager and assuming that you will not switch to MSSQL database when restoring the backed-up data.
2

BackupDB_Postgres.bat/sh


Arguments: mode, destination, exclude, threads


mode*: Backs up either both performance and configuration data or configuration data alone
possible values: all, configdata ('all' backs up both performance and configuration data while 'configdata' backs up configuration data alone)


destination: This option is used to store the backup file in different location. By default it will be stored in <OpManager Home/backup> directory.


exclude: Allows you to exclude netflow and ncm plugin data while taking backup
possible values: ncm, netflow


threads: Increasing the number of threads will increase the backup speed. Default thread count is 10, but you can extend up to 15.


Examples:

  • BackupDB_Postgres.bat -mode all -exclude netflow
  • BackupDB_Postgres.bat -mode configdata -threads 12 -destination c:\manageengine

*- Mandatory field

-do- PostrgreSQL This utility does a backup of the complete database, viz., performance and configuration data.

If you are using PostgreSQL bundled with OpManager and assuming that you will not switch to MSSQL database when restoring the backed-up data.
3

CrossDBBackup.bat/sh


Arguments: mode, targetdb, destination, exclude, threads


mode*: backs up performance data or configuration data or configuration files or all the aforesaid.
possible values: all, configdata, configfiles ('all' backs up both performance and configuration data while 'configdata' backs up configuration data alone. When you backup the DB using Microsoft SQL Enterprise, it does a backup of only the database and ignores the configuration files which are required to run OpManager properly. To backup those configuration files, use the 'configfiles'.)


targetdb*: The target database that you are going to restore the backup.
possible values: mysql, mssql, pgsql


destination: This option is used to store the backup file in different location. By default it will be stored in <OpManager Home/backup> directory.


exclude: Allows you to exclude netflow and ncm plugin data while taking backup
possible values: ncm, netflow


threads: Increasing the number of threads will increase the backup speed. Default thread count is 10, but you can extend up to 15.


Examples:

  • CrossDBBackup.bat -mode all -exclude ncm -targetdb pgsql
  • CrossDBBackup.bat -mode configdata -threads 12 -destination c:\manageengine -targetdb mssql
  • CrossDBBackup.bat -mode all -exclude netflow -targetdb mssql

*- Mandatory field

-do- MSSQL/ MySQL/ PostgreSQL This utility does a backup of the complete database,  viz., performance and configuration data.

Use this tool if you are migrating the database across MSSQL, MySQL & PostrgreSQL.


Restoration
To restore the backed up data,

  1. Go to <OpManager Home>/bin/backup directory
  2. Execute RestoreDB.bat/sh with the backup file name as argument. See example below:
    C:\<OpManager Home>\bin\backup>RestoreDB.bat BackUp_APR3_2009_17_43_38_8100.zip

While restoring the backup, the tables that are dropped or retained varies according to the backup file restored:

Options:

Examples :

Note: If you are restoring from PostrgeSQL or MySQL database to MSSQL, download and install SQL native client (refer the installation video) and follow the steps given below:

  1. Ensure that the files bcp.exe and bcp.rll files are present under /opmanager home folder. You will find these files in MSSQL installation setup.
  2. If the MSSQL server is installed on a 64-bit OS, and OpManager is installed on 32-bit server, the bcp.exe and bcp.rll copied from the MSSQL server will not work on the OpManager machine. You'll need a 32-bit bcp.exe and bcp.rll.


Backup & restoration steps for OpManager build 9410 and below


Backup

Following table lists the backup utilities bundled with OpManager and their purpose. Make sure you use the one that fits your backup need:

S.No
Utility
Path
Database
Purpose
1
BackupDB_Mysql.bat/sh
OpManager Home>/bin/backup
MySQL
This utility does a backup of the complete database, viz., performance and configuration data.

If you are using MySQL bundled with OpManager and assuming that you will not switch to MSSQL database when restoring the backed-up data.

Ensures a quick backup.
2
BackupDB_Mysql_Config.bat/sh
-do-
MySQL Use this tool if you want to backup only the configuration data and not the performance data.

This requirement arises when you decide that you want to drop all the performance data and start afresh in the same or new machine, but keep all the configurations alone intact.

Ensures a quick backup.
3
BackupDB.bat/sh
-do- MSSQL/MySQL This utility does a backup of the complete database,  viz., performance and configuration data.

Use this tool if you are using MSSQL as the database. It can also be used for MySQL database besides BackupDB_Mysql.bat/sh, but might take a longer time to backup.

Advantage of using this utility is that you can backup and restore from MySQL to MSSQL and vice versa.
4
BackupDB_Config.bat/sh
-do- MSSQL/MySQL Use this tool if the OpManager database is MSSQL  and if you want to backup only the configuration data and not the performance data.

This requirement arises when you decide that you want to drop all the performance data and start afresh in the same or new machine, but keep all the configurations alone intact.
5
Microsoft SQL Enterprise Manager + BackupConfFiles.bat
-do- MSSQL You can also use Microsoft SQL Enterprise Manager to backup the database.

When you use this tool, make sure to backup the configuration files too using the BackupConfFiles.bat utility because the SQL  Enterprise Manager does a backup of only the database and ignores the configuration files which are required to run OpManager properly.
6
Using third party backup utility + BackupConfFiles.bat
-do- MSSQL/MySQL When you use any third party backup utility, make sure to backup the configuration files too using the BackupConfFiles.bat  utility because the SQL Enterprise Manager does a backup of only the database and ignores the configuration files which are required to run OpManager properly.

Name & Location of the backup files
The backup file created is of the format:  <filename>_<date>_<time>_<build number>.zip

Example: BackUp_APR3_2009_17_43_38_8100.zip.

The backup files are stored under OpManager Home/backup directory. To store the backup file in another directory other than the default directory (<OpManager Home/backup>), follow the procedure below:

  1. Open a command prompt.
  2. From the command prompt, execute the backup script (that meets your requirement) with the path of the destination directory as argument as follows:
    <backup execution command> -destination <path of the destination directory>

    Example:
    BackupDB_Mysql.bat -destination D:\OpManager_backup

Restoration
To restore the backed up data,

  1. Go to <OpManager Home>/bin/backup directory
  2. Execute RestoreDB.bat/sh with the backup file name as argument. See example below:
    C:\<OpManager Home>\bin\backup>RestoreDB.bat BackUp_APR3_2009_17_43_38_8100.zip

While restoring the backup, the tables that are dropped or retained varies according to the backup file restored:

Copyright © 2012, ZOHO Corp. All Rights Reserved.
Network Monitoring Software from ManageEngine