Data Backup and Restore


You can take a backup of Applications Manager data and restore them back by executing the scripts BackupPGSQLDB.bat/.sh and RestorePGSQLDB.bat/.sh respectively available under <Applications Manager Home>/bin directory.

Backup

To take a back up of Applications Manager data, execute the following commands in the command prompt:

BackupPGSQLDB.bat/.sh

After executing the above command, the output (backup data) would be added in a ZIP file under <Applications Manager Home>\working\backup\ directory in the following format:

...\APM_backupzip_<backupType>_<Table/DB>_<date>_<time>\APM_backupzip_<backupType>_<Table/DB>_<date>_<time>.zip

For example, the ZIP file of the backup would be added under C:\Program Files\ManageEngine\AppManager14\working\backup\APM_backupzip_all_dumpDB_pgsql_NORM_14550_Mar_10_2020_17_16_21\APM_backupzip_all_dumpDB_pgsql_NORM_14550_Mar_10_2020_17_16_21.zip file.

Restore

To restore the backed up data, execute the following command in command prompt:

RestorePGSQLDB.bat/.sh "<Absolute path of the zip file that was backed up on executing BackupDB script>"

Example:

RestorePGSQLDB.bat/.sh "C:\Program Files\ManageEngine\AppManager14\working\backup\APM_backupzip_all_dumpDB_pgsql_NORM_14550_Mar_10_2020_17_16_21\APM_backupzip_all_dumpDB_pgsql_NORM_14550_Mar_10_2020_17_16_21.zip"

Note: Database backup can be taken both in running or shutdown states of Applications Manager.

Filtering data for backup

You can also choose to filter out specific data while taking backup of Applications Manager using the command given below:

BackupPGSQLDB.bat <Runtime command of required data>

By using specific runtime commands, you can choose to take backup for the required data and filter out unnecessary ones. Below are the list of data and their corresponding runtime commands:

Backup Data Runtime Command
Complete database alone --database
Only Configuration files --confiles
Only Report tables --reports
Only Configuration tables --configtables
Exclude Report tables --exclude-reports
Exclude Poll Data tables --exclude-raw

Example 1:

To take backup of report data, command should be executed as follows:

BackupPGSQLDB.bat --reports

Example 2:

To backup and restore the Configuration files and Configuration tables, follow the steps given below:

  1. Execute BackupPGSQL.bat/sh --confiles to take config file backup.
  2. Execute BackupPGSQL.bat/sh --configtables to take config table backup.
  3. Restore the backups by execting below command by replacing <backupfile> with configuration files backup.
  4. Once the restoration is complete, execute the RestorePGSQL.bat/.sh command with configuration tables backup file:
    RestorePGSQL.bat/sh <backupfile>

Note: In Enterprise Edition, backup of report or configuration data (like --reports, --configtables, --exclude-reports, --exclude-raw) taken from one server should not be restored in another server.

Configuring a backup task

You can configure a backup task with Task Scheduler as follows:

Program/Scripts: <Applications Manager Home>\bin\BackupPGSQLDB.bat

Start In: <Applications Manager Home>\bin\

  • Configure the triggers and other information in the Task Scheduler. Please make sure you choose the option "Run whether the User is Logged On or Not" so that the Task runs irrespective of the fact that the user is logged on or not.
  • In the Actions, please configure it as follows

Program/Scripts: <Applications Manager Home>\bin\BackupPGSQLDB.bat

Start In: <Applications Manager Home>\bin\

  • Then save the task and test it to know if it works.

For Microsoft SQL Server backend:
  • For Database Backup: Connect to the SQL Management Studio tool & backup the complete AMDB database. Click here to know how to backup SQL database.
  • For Database Restore: Connect to SQL Management Studio tool & restore the complete AMDB database backup. Click here to know how to restore the SQL database backup.
Applications Manager should not be running during database restore. Refer the below link for more detailed information about SQL database backup & restore steps: https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/back-up-and-restore-of-sql-server-databases

Note: Users should not use the SQL Server Import and Export Wizard to perform backup or restore of Applications Manager database.