How to migrate external PostgreSQL server keeping the ADSelfService Plus server intact
Last updated on:In this article
Objective
This article outlines the steps to migrate the external PostgreSQL (PGSQL) database used by ADSelfService Plus to a new PGSQL server, while keeping the existing ADSelfService Plus application server unchanged.
This process is particularly useful when the existing database server is vulnerable or outdated, as migrating to a new server ensures enhanced security and performance. The goal is to achieve a seamless backend transition without disrupting the application layer or its functionality.
Prerequisites
Before initiating the migration process, ensure the following:
- Administrative privileges: Administrative access to the ADSelfService Plus application server and both the current and new PGSQL servers.
- PostgreSQL version: The new PostgreSQL server must be running a compatible version (version 12, 13, 14 or 15). Using a significantly different version might lead to compatibility issues.
- Backup: A complete backup of the ADSelfService Plus installation directory.
- Network connectivity: The new PGSQL server must have the same firewall exceptions as the old server to ensure uninterrupted communication with the ADSelfService Plus server.
- Permissions: Database owner privileges to perform backup and restore operations on both PostgreSQL servers, and administrative privileges to execute commands on the ADSelfService Plus application server.
- Database credentials: The necessary credentials (hostname, port, database name, username, and password) for the new PostgreSQL database.
Steps to follow
Step 1: Backup the existing PGSQL database
- On the old PostgreSQL server, create a full backup of the ADSelfService Plus database using standard backup tools or with the help of your database administrator.
Step 2: Restore the backup on the new PGSQL server
- On the new server, restore the backup using standard PostgreSQL restoration tools or with the assistance of your database administrator.
The master key can only be retrieved from the application server by the support team. If you are prompted to provide a master key, please contact support@adselfserviceplus.com for assistance.
Step 3: Stop the ADSelfService Plus application
- If ADSelfService Plus is running as a service, stop it via Services.msc.
- If ADSelfService Plus is running as an application, exit it from the system tray.
Step 4: Run the database configuration script
On the ADSelfService Plus application server:
- Right-click Command Prompt and choose Run as Administrator.
- Navigate to the ADSelfService Plus bin directory located in C:\Program Files\ManageEngine\ADSelfService Plus\bin
- Execute the database change script changeDB.bat. This script will launch the Database Configuration Wizard.
-
For ADSelfService Plus build 6527 and later
A) In the Database Setup Wizard that appears:
- Select Pgsql Server as the Server Type (default option).
- Provide the connection details for your new PostgreSQL server.
- Host Name: The hostname or IP address of the new PostgreSQL server.
- Port: The port number used by the new PostgreSQL server (e.g., 5432).
- Database Name: The name of the database that ADSelfService Plus will use on the new server.
- User Name: The username used to connect ADSelfService Plus to the database.
- Password: The password for the specified database user.
- To migrate your existing data to the new database server, check the Migrate Data From Existing Server checkbox. Leave it unchecked if you are setting up a fresh database with no data to migrate.
- Click Test to verify the connection with the new server details. If the connection fails, recheck your credentials and network connectivity, then try again.
- Once the connection test is successful, click Save.
For ADSelfService Plus builds prior to 6527
B) In the Database Setup Wizard that appears:
- Select Pgsql Server as the Server Type (default option).
- Provide the connection details for your new PostgreSQL server.
- Host Name: The hostname or IP address of the new PostgreSQL server.
- Port: The port number used by the new PostgreSQL server (e.g., 5432).
- Database Name: The name of the database that ADSelfService Plus will use on the new server.
- User Name: The username used to connect ADSelfService Plus to the database.
- Password: The password for the specified database user.
- Click Test to verify the connection with the new server details. If the connection fails, recheck your credentials and network connectivity, then try again.
- Once the connection test is successful, click Save.
The Migrate Data From Existing Server checkbox is not available in builds prior to 6527. Data migration must be performed manually using standard SQL migration procedures before or after reconfiguring the database connection.
Step 5: Start ADSelfService Plus
- Press Win + R to open the Run dialog box.
- Type services.msc and press Enter.
- In the Services list, find ManageEngine ADSelfService Plus.
- Right-click the service and select Start.
Validation and confirmation
After completing the migration steps, perform the following to confirm success:
- Application launch: Ensure the ADSelfService Plus application starts successfully without any database connection errors.
- Data verification:
- Log in to the ADSelfService Plus portal.
- Verify data consistency by checking reports and the dashboard.
- Functionality test:
- Perform a few common user self-service operations (e.g., password reset, account unlock).
- Test administrator functionalities (e.g., managing policies, users).
- Log files check: Review the ADSelfService Plus server logs (located in <ADSelfService Plus_Installation_Dir>\logs) for any database connectivity issues or errors related to the migration.
