How to upgrade the PostgreSQL database in ADManager Plus on a new server

How to upgrade the PostgreSQL database in ADManager Plus on a new server

Objective 

This article explains how to upgrade the bundled PostgreSQL database in ADManager Plus to the latest supported version on a new server. Performing this upgrade helps improve performance, strengthen data security, and ensure compatibility with the latest ADManager Plus builds. This process is especially recommended during version upgrades or when migrating to a new server environment for long-term stability and scalability in enterprise setups.

Prerequisites   

  • Ensure the ADManager Plus installation directory is excluded from antivirus scans.

  • Create a full backup of the installation folder or take a server snapshot before starting the upgrade process.

Steps to follow 

 Case 1: Steps to upgrade PostgreSQL for ADManager Plus (Build 7230 or later)      

Step 1: Stop ADManager Plus

    • Go to Start > ADManager Plus > Stop ADManager Plus.

    • If ADManager Plus is running as a Windows service, stop it via Start > Run > services.msc > ManageEngine ADManager Plus > Stop.

    • If high availability is enabled, also stop the ManageEngineADManagerPlusPostgres service from the Services Console.

Step 2: Back up the database

    1. Open Command Prompt as administrator.

    2. Navigate to \<Installation_Dir>\ADManager Plus\bin and run backupDB.bat.

    3. A backup folder will be created inside the installation directory containing your database backup (e.g., OfflineBackup_<timestamp>.ezip).

    4. The backup file is protected using the CryptTag value from the customer-config.xml file found in the <conf> directory.

Step 3: Download and upgrade PostgreSQL v15.6

    1. Download PostgreSQL 15.6.

    2. In the ADManager Plus installation directory, create a new folder named NewPgsql.

    3. Move the downloaded PostgreSQL ZIP file into this NewPgsql folder.

    4. Navigate to \<Installation_Dir>\ADManager Plus\bin and execute upgradePG.bat.

Step 4: Restart ADManager Plus

    1. Launch the application via Start > ADManager Plus > Start ADManager Plus.

 Case 2: Steps to upgrade PostgreSQL for ADManager Plus (Builds below 7230)     

Step 1: Stop ADManager Plus

    • Go to Start > ADManager Plus > Stop ADManager Plus.

    • If running as a Windows service, stop it via Start > Run > services.msc > ManageEngine ADManager Plus > Stop.

Step 2: Back up the database

    1. Open Command Prompt as administrator.

    2. Navigate to \<Installation_Dir>\ADManager Plus\bin and run backupDB.bat.

    3. A Backup folder will be created in the installation directory, containing the database backup (e.g., OfflineBackup_<timestamp>.ezip).

    4. The backup file is password-protected using the CryptTag value, which can be found in the customer-config.xml file located in \<Installation_Dir>\ADManager Plus\conf.

Step 3: Copy configuration and data files

From your current installation directory, copy the following:

    1. Archive, ES, and esdata folders.

    2. customer-config.xml file from the conf folder.

Step 4: Reinstall the same build

    1. Download the same ADManager Plus build version used previously.

    2. Run the installer but do not start the application after setup. Uncheck Start ADManager Plus in console mode in the final step.

Step 5: Restore configuration and data files

    1. Paste the previously copied Archive, ES, and esdata folders into the new installation directory.

    2. Replace the new customer-config.xml with your original one.

    3. Copy your backup file (e.g., OfflineBackup_<timestamp>.ezip) into the bin folder of the new installation.

Step 6: Restore the database

    1. Open Command Prompt as administrator.

    2. Navigate to \<Installation_Dir>\ADManager Plus\bin.

    3. Run the following command:
      restoreDB.bat <backup_file_name> -p
      Example: restoreDB.bat OfflineBackup_20230215191814.ezip -p

    4. When prompted for password, use the CryptTag value from your original customer-config.xml as the password (unless a different password was set in ADManager Plus, Admin > General Settings > Security and Privacy > Privacy Settings).

Step 7: Start ADManager Plus and apply your license

    1. Launch the product using the Start menu or Service Manager.

    2. Reapply your license file. Use the original file sent to your email from licensing@manageengine.com, or retrieve it from the old instance’s lib directory as AdventNetLicense.xml.

 Case 3: Upgrading the database in older builds of ADManager Plus (Builds older than 7140)     

Step 1: Stop ADManager Plus and its database  

    • Go to Start > All Programs > ADManager Plus > Stop ADManager Plus.

    • If ADManager Plus is installed as a Windows service, open Run > services.msc, find ManageEngine ADManager Plus, and click Stop.

    • To stop the database, navigate to \<Installation_Dir>\ADManager Plus\bin and run StopDB.bat.

Step 2: Back up the existing database  

    1. Go to \<Installation_Dir>\ADManager Plus\bin, right-click backupDB.bat, and select Run as administrator.

    2. This will generate a backup in a folder named Backup located inside the installation directory (e.g., OfflineBackup_20230215191814.ezip).

Step 3: Copy configuration files

From your current installation directory, copy the following:

    1. The Backup folder with the database backup (OfflineBackup_*.ezip)

    2. Archive, ES, and esdata folders.

Step 4: Download and install the required build  

    1. Download the required ADManager Plus build version and install it on the new server.

    2. After installation, launch the product once in console mode, then close it by right-clicking the system tray icon > Stop ADManager Plus.

Step 5: Paste configuration files  

Paste the previously copied Archive, ES, and esdata folders into the new installation directory.

    1. Place the backup file in \<New_Installation_Dir>\ADManager Plus\bin

    2. Place the Archive, ES, and esdata folders in the root of the new installation directory

Step 7: Restore the database  

    1. Open Command Prompt as the ADManager Plus service account.

    2. Navigate to the bin folder, cd <drive letter>:\<New_Installation_Dir>\ADManager Plus\bin

    3. Run the restore command:

Info
  1. restoreDB.bat <backup_file_name> -p

Example: restoreDB.bat OfflineBackup_20210116225934.ezip -p


Notes

Note: The backup file is password protected. Use the reverse of the backup file name as the password. For example, for OfflineBackup_20210116225934.ezip, the password would be 43952261101202_pukcaBenilffO

Step 8: Reinstall ADManager Plus as a service  

    1. From the same Command Prompt window, run wrapper.exe -i ..\conf\wrapper.conf

Step 9: Start ADManager Plus

    1. Open Run > services.msc

    2. Locate ManageEngine ADManager Plus and click Start

Step 10: Apply the license and SSL certificate  

    1. Copy the license file AdventNetLicense.xml from the old instance’s bin\license folder. Apply it to the new instance.

    2. If an SSL certificate was configured previously, reapply it using the SSL Certificate Tool. 

 Tips 

  • Use correct command syntax: Make sure the restoreDB.bat command is typed correctly, including the backup file name.

  • Follow build-specific steps: Always follow the procedure corresponding to your ADManager Plus build version.

  • Stop the database service fully: Ensure PostgreSQL is not running before starting the restoration.

  • Validate backup integrity: Only restore from verified, untampered backup files.

  • Back up regularly: Schedule routine backups to minimize data loss risk.

  • Monitor logs: Regularly check system logs for PostgreSQL or restoration-related errors.

 

                  New to ADSelfService Plus?