Database Backup and Restore

 

This document explains you about creating a database backup and restoring it. Creating a backup of the database is an essential need for every enterprise.
So you need to ensure that the significant data is backed up periodically.  Follow the methods mentioned below to backup and restore your database.

Manual Data Backup:

OpUtils currently supports database backup and restore for MSSQL and PostgreSQL(PGSQL) database.  
Database backup can be done manually by following the steps mentioned below:

Back Up MSSQL database

Prerequisites for MSSQL database backup:

Note: BCP should be installed on the computer where OpUtils is installed.
If OpUtils and MSSQL Server are installed in the same machine, ensure that BCP is working. You can verify that, by following the steps mentioned below:

    1. Open Command Prompt
    2. Type bcp and press Enter. If bcp is not installed or not working on the machine, then you will receive an error message "BCP not recognized", else you can view the listed usage details.

If OpUtils and MSSQL server are installed on different computers, then follow the steps mentioned below:

    1. Go the machine where MSSQL server is installed
    2. Copy the bcp.exe and bcp.rll
    3. Go the the machine where OpUtils is installed
    4. Paste the copied files to the location where OpUtils is installed  <OpUtils Home>\bin folder. Ensure that you use the appropriate edition such as 32 bit or 64 bit. For example, if OpUtils is installed on a 32 bit machine and the MSSQL server is installed on 64 bit machine, then the bcp copied from that MSSQL machine will not work in 32 bit machine.
    5. Go to Services, on the machine where MSSQL is installed, start the "SQL Browser Service"
    6. Download the same version of MSSQL Server Native Client from the Microsoft website.
    7. Install it on the OpUtils Server.

 

Follow the steps mentioned below to backup MSSQL database:

  1. Open command prompt and locate OPUTILS_HOME\bin ( Eg. C:\Program Files\ManageEngine\OpUtils\bin )

  2. Execute backupDB.bat <backup-directory> <backup-filename>
    For Example: backupDB.bat C:\Program Files\ManageEngine\OpUtils\ScheduleBackup\ ManualBackUp_5_Aug_2013

  3. Ensure that the data backup  is successfully stored in the location <backup-filename>.zip (ManualBackUp_5_Aug_2013.zip)

You have successfully stored the MSSQL database backup.

 

Back Up PGSQL database

Follow the steps mentioned below to backup PGSQL database:

  1. Open command prompt and locate OPUTILS_HOME\bin ( Eg. C:\Program Files\ManageEngine\OpUtils\bin )

  2. Execute backupDB.bat/sh <backup-directory> <backup-filename>
    For Example: backupDB.bat C:\Program Files\ManageEngine\OpUtils\ScheduleBackup\ ManualBackUp_5_Aug_2013

  3. Ensure that the data backup  is successfully stored in the location <backup-filename>.zip (ManualBackUp_5_Aug_2013.zip).

You have successfully stored the PGSQL database backup.

Schedule Data Backup

Follow the steps mentioned below to schedule the database backup:

  1. Go to OpUtils

  2. Click Admin tab

  3. Under Admin from the left pane, click Scheduled Backup

  4. Specify the Backup Directory

  5. Specify the number of backups that need to be maintained

  6. Select the drop down to enable/disable the Backup Scheduler and specify the time interval for the database backup to be performed

  7. Click Save to store the changes.   

You have successfully scheduled the database backup.

 

Restore Data

Restore MSSQL Database

Follow the steps mentioned below to restore the MSSQL database:

  1. Stop the OpUtils server

  2. Go to the machine where MSSQL database is installed and rename or delete the corrupted database "OpUtilsDB" to "OpUtilsDB_Corrupted"

  3. Create a new database "OpUtilsDB"

  4. Go to machine where OpUtils is installed and navigate to the location OPUTILS_HOME\bin

  5. Execute restoreDB.bat <backup-zipfile>
    For Example: restoreDB.bat C:\Program Files\ManageEngine\OpUtils\ScheduleBackup\ManualBackUp_5_Aug_2013.zip

  6. After the batch execution is complete, Start the OpUtils server

You have successfully restored the MSSQL database backup.

 

Restore PGSQL Database

Follow the steps mentioned below to restore the PGSQL database:

  1. Stop the OpUtils server

  2. Execute restoreDB.bat/sh <backup-zipfile>
    For Example: restoreDB.bat C:\Program Files\ManageEngine\OpUtils\ScheduleBackup\ManualBackUp_5_Aug_2013.zip

  3. After the batch execution is complete, Start the OpUtils server

You have successfully restored the PSQL database backup.

 

Copyright © 2004-2012, ZOHO Corp. All Rights Reserved.
ManageEngine