To change the vCenter Server user password in embedded vpostgres database:
- Connect to the Windows OS installed in vCenter Server.
- Open the command prompt and stop all services by running this command to avoid inconsistency (downtime start):
"C:\Program Files\VMware\vCenter Server\bin\service-control" --stop --all
- Start the vPostgress service:
"C:\Program Files\VMware\vCenter Server\bin\service-control" --start vPostgres
- Change the vc user password, if needed:
- Go to the C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx\vcdb.properties folder and make a note of vc user password.
- Go to C:\Program Files\VMware\vCenter Server\vPostgres\bin\ directory in the command prompt.
- Log into the vpostgres database as vc user by running this command and use the password from step #a:
psql -d VCDB -U vpostgres
- Use this command to change the password:
\password
- Run this command and enter the "new-password" when prompted:
"C:\Program Files\VMware\vCenter Server\vpxd\vpxd.exe" -p
Note: If you want to change vpostgres user password, follow below steps. If not skip to step #5.
- Change the postgres user password, if needed:
- Go to the C:\Windows\System32\config\systemprofile\AppData\Roaming\postgresql\pgpass.conf file and make a note of postgres user password.
- Go to C:\Program Files\VMware\vCenter Server\vPostgres\bin\ directory in the command prompt.
- Login in the database as postgres user with password from step #a:
psql -d postgres -U postgres
Example: Default port is 5432, in case of custom port is in use like 5433 or any other port try below syntax:
psql.exe -d postgres -U postgres --port=5433
- Change password:
\password
- Edit the pgpass.conf file with the new postgres user password.
- After all user password changes stop the vpostgres service and start all after that (downtime ends).
"C:\Program Files\VMware\vCenter Server\bin\service-control" --stop vPostgres
"C:\Program Files\VMware\vCenter Server\bin\service-control" --start --all