Home / Product FAQ / Miscellaneous / change Applications Manager PostgreSQL password

change Applications Manager PostgreSQL password


How to change Applications Manager bundled PostgreSQL (PGSQL) database postgres user password?

Note: Take backup of below information
 
* AppManagerHome\working\pgsql\data\amdb folder 

* AppManagerHome\working\conf\PGSQL\database_params.conf file

* AppManagerHome\working\conf\database_params.conf file

Follow the below steps to change postgres user password:

1. Stop the instance of Applications Manager running currently. In windows stop ManageEngine Applications Manager service, in Linux run the shutdownApplicationsManager.sh script.

2. Go to AppManagerHome/working/bin directory and execute below command.

sh startPGSQL.sh (for Linux)

startPGSQL.bat (for Windows)

3. Execute the following command in the command prompt of the Applications Manager server. This will connect to the Applications Manager PostgreSQL database. You will be prompted for password. Give the default password as 'appmanager' and you will be connected to PostgreSQL database now.

Windows Command:

AppManagerHome\working\pgsql\bin>psql -p 15432 -U postgres 

Linux Command:

AppManagerHome/working/pgsql/bin$./psql -p 15432 -U postgres 

Where, 15432 is the default PostgreSQL port and this can be checked in AppManager_Home/conf/AMServer.properties file in the "am.db.port" parameter.

4. Execute the following commands in PostgreSQL prompt as exactly as given below with your new chosen password.

ALTER USER "postgres" WITH PASSWORD 'NewPasswordHere';

5.After this, stop the PostgreSQL that is running.Open a new command prompt window, go to AppManagerHome/working/bin/ directory and execute below command to do that.

sh stopPGSQL.sh (for Linux)

stopPGSQL.bat(for Windows)

6. Change the value of password in database_params.conf file under AppManagerHome/working/conf/PGSQL/ directory. Edit the file database_params.conf and you will find below lines in it.

# login password for the database if any
encryptedpassword eK6q1CJ9697s7O AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

Change it as below,

# login password for the database if any
password NewPasswordHere AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

Change the encryptedpassword to password , followed by your NewPasswordHere in the database_params.conf file, while restarting it will be automatically encrypted again.Just replace the string 'eK6q1CJ9697s7O' with the new password of the postgres user.

7. Do the changes mentioned in step 6 in the database_params.conf file under AppManagerHome/working/conf/ as well.

8. Also update the NewPasswordHere of PostgreSQL database in the AppManager/bin/BackupPGSQLDB.bat & RestorePGSQLDB.bat files under 'PGPASSWORD' parameter as well.

9. Restart the Applications Manager and the password will be successfully changed.






     RSS of this page