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 10200 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.bat (for windows)

BackupDB.sh (for linux)

OpManager\bin\backup Mysql | MSSQL | PGSQL This utility does a backup of the complete database, viz., performance and configuration data.
2

BackupDB.bat -mode configdata (for windows)

BackupDB.sh -mode configdata (for linux)

OpManager\bin\backup Mysql | MSSQL | PGSQL Use this tool if you want to backup only the configuration data with this we backup Conf, Images folder and get the details of Devices, Device Templates, Interfaces, Interface Template, Dashboards & Widgets, Infrastructure Views, Business Views, Credentials, Notification Profiles, Users but not the performance data.

 

Restoration

 

To restore the backed up data,

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

To restore the backed up data for MSSQL

  1. Go to <OpManager Home>/bin/backup directory
  2. Restore the data using RestoreDB.bat present under OpManager/bin/backup directory and restart OpManager.

      For ex : C:\<OpManager Home>\bin\backup>RestoreDB.bat "c:\OpManager\backup\BackUp_APR3_2009_17_43_38_8100.zip"

 

Important Note : If your migrating the database from PostgreSQL or MySQL to MSSQL, please follwo the steps below.

 

  1. Download the SQL Native Client from the link below. You will need to scroll down the page for the Native Client downloads:

    http://www.microsoft.com/download/en/details.aspx?id=16978 Microsoft SQL Server 2008 R2 Native Client (SQL Server Native Client) is a single dynamic-link library (DLL) containing both the SQL OLE DB provider and SQL ODBC driver. It contains run-time support for applications using native-code APIs (ODBC, OLE DB and ADO) to connect to Microsoft SQL Server 2000, 2005, or 2008. SQL Server Native Client should be used to create new applications or enhance existing applications that need to take advantage of new SQL Server 2008 R2 features. This redistributable installer for SQL Server Native Client installs the client components needed during run time to take advantage of new SQL Server 2008 R2 features, and optionally installs the header files needed to develop an application that uses the SQL Server Native Client API.                                  

    X86 Package (sqlncli.msi) X64 Package (sqlncli.msi) IA64 Package (sqlncli.msi)

    For more details on installing the native client, refer this site: http://msdn.microsoft.com/en-us/library/ms131321.aspx

    Courtesy: http://msdn.microsoft.com                                                                                                                                                                                                     Here is a quick video of SQL Native client installation.

  2. Find the files bcp.exe and bcp.rll in MSSQL server and ensure to copy it under opmanager home folder. 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.

     

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

BackupDB.bat/sh: During restoration, all the existing tables are dropped, new tables are created, and the data are restored.

BackupDB.bat/sh -Mode configdata: During restoration, all the existing tables are dropped, new tables are created, and only the configuration data are restored.


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:

  • exclude: Used to skip restore data for ncm and netflow plugin.
    Possible values : ncm, netflow
  • threads - Increasing the number of threads will increase the restore speed.
    Value should be less than 15. default 10.

Examples :

  • RestoreDB.bat BackUp_APR3_2009_17_43_38_8100.zip
  • RestoreDB.bat BackUp_APR3_2009_17_43_38_8100.zip -exclude ncm,netflow

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:

  • BackupDB.bat/sh: During restoration, all the existing tables are dropped, new tables are created, and the data are restored.
  • BackupDB_Config.bat/sh: During restoration, all the existing tables are dropped, new tables are created, and only the configuration data are restored.
  • BackupDB_Mysql.bat/sh: During restoration, all the existing tables are dropped, new tables are created, and the data are restored.
  • BackupDB_Mysql_Config.bat/sh: During restoration, all the existing tables are dropped, new tables are created, and only the configuration data are restored.
  • BackupConfFiles.bat/sh: During restoration, no tables get dropped. Only the configurations files are restored.