OpManager DB migration from PGSQL to MSSQL in Version 125230
For OpManager version 125230:
PGSQL to MSSQL Migration Steps :
- In the PGSQL setup, go to OpManager home → bin, start Command Prompt with administrator privilege from this path and run DBConfiguration.bat.
- In the popup shown, please chose MSSQL, check "Migrate data from the existing database" option and click OK.
- After the migration is complete, start the product and check if it is working properly
MSSQL to PGSQL Migration (For Prepopulated and non prepopulated setups):
- In the MSSQL setup, make the below changes in db_migration.conf in the <OpManagerHome>\conf directory.
- Change the value of dest.db.postgres.dir to <OpManagerHome>/pgsql directory (E.g., dest.db.postgres.dir = <OpManager Base Home>/pgsql).
Note: It is mandatory to use "/" as a directory separator.
- Now go to OpManager home → bin, start Command Prompt with administrator privilege from this path and run DBConfiguration.bat.
- In the popup shown, please chose PostgreSQL and check "Migrate data from the existing database" option and click OK.
- After the migration is complete, start the product and check if it is working properly.
MSSQL to PGSQL Migration (Remote PGSQL)
- In the MSSQL setup, make the below changes in db_migration.conf in <OpManager Base Home>\conf directory.
- create.dest.db=false
- start.dest.postgres.server=false
- Rename the database_params_dbconfig.conf.bkp file in <OpManagerHome></OpManagerHome>\conf\OpManager\POSTGRESQL folder if it exists.
- Create a database in Remote PostgreSQL server.

- Create 'rouser' for read-only permissions. Connect to pgAdmin and execute the below queries:
- CREATE USER rouser with password '<ROPASSWORD>';
- CREATE EXTENSION IF NOT EXISTS pgadmin SCHEMA pg_catalog;
- REVOKE ALL ON SCHEMA public FROM rouser, public;
- GRANT CONNECT ON DATABASE "<DatabaseName>" TO rouser, public;
- GRANT USAGE ON SCHEMA public TO rouser, public;
- GRANT SELECT ON ALL TABLES IN SCHEMA public TO rouser, public;
- ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT SELECT ON TABLES TO rouser, public;
- GRANT USAGE ON SCHEMA public TO rouser;
- GRANT SELECT ON ALL TABLES IN SCHEMA public TO rouser;
- ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO rouser;

- Changes to be made in the <OpManagerHome>\conf\OpManager\POSTGRESQL\database_params.conf
- Make the changes in URL field jdbc:postgresql://<remotePgSQLInstalledIPAddress>:<PortNumber>/<DBName>?dontTrackOpenResources=true&useUnicode=true&characterEncoding=utf8
- Change the username to postgres. (username=postgres)
- Encrypt the password of the postgres user and change the same in the above mentioned. file (password=<EncryptedPassword>)
- Add the property isBundledPgSQL=false as well in the same file.
- Change the ro_password to the password supplied in point 4 <ROPassword>. Encrypt the same and include it in the same file (ro_password=<ROPassword>)
- Encryption of the plain text can be done using <OpManagerHome>\bin\encrypt.bat by specifying the algorithm as AES.256 and by using CryptTag which can be found in <OpManagerHome>\conf\customer-config.xml (Usage:: encrypt.bat -v <Password> -a AES.256 -k <CryptTag> )

- Now go to OpManager home → bin, start Command Prompt with administrator privilege from this path and run DBConfiguration.bat.
- In the popup shown, please chose PostgreSQL and check the "Migrate data from the existing database" option and click OK.
- After the migration is complete, start the product and check if it is working properly.

New to ADSelfService Plus?