We were upgrading VMware SRM environment from version 6.5 to version 8.1, it was running with embedded PostgreSQL database. Unfortunetly, we forgot the password of DB Admin user which was must needed to proceed for rest of the upgradation part. Later, we thought to reset the password which worked perfectly for us, so wanted to share the same thing with you if you are also in same situation and want to use this trick.
Login to VMware Site Recovery Manager server where you have installed embedded PostgreSQL. Access below path and make a copy of pg_hba.conf
C:\ProgramData\VMware\VMware vCenter Site Recovery Manager Embedded Database\data
Here I have created another copy of pg_hba.conf which I will use to modify the information.
Stop service as showing below.
Display Name - VMware vCenter Site Recovery Manager Embedded Database
Service Name - vmware-dr-vpostgres
Open pg_hba.conf file in notepad and highlight the following lines.
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
Replace md to trust as showing in below file.
Save this file in same location as mentioned below.
C:\ProgramData\VMware\VMware vCenter Site Recovery Manager Embedded Database\data
Start service as showing below.
Display Name - VMware vCenter Site Recovery Manager Embedded Database
Service Name - vmware-dr-vpostgres
Locate below path in same VMware SRM server where you have installed embedded PostgreSQL server.
C:\Program File\VMware\VMware vCenter Site Recovery Manager Embedded Database\Bin
Open Command Prompt using Administrator Priviledge and navigate to the directory.
cd "C:\Program File\VMware\VMware vCenter Site Recovery Manager Embedded Database\Bin"
Run below command to connect to PostgreSQL database.
psql -U postgres -p 5678
Run the following to change the password -
ALTER USER "srm_db_user_name" PASSWORD 'new_password';