SoftActivity

How to reset PostgreSQL database password for SoftActivity software

By default, SoftActivity uses the following user name for PostgreSQL database: softactivity
The password for the database is set by the administrator during SoftActivity product installation.

By default, connections to the database are only accepted from the local computer where PostgreSQL server is installed. This is done for security reasons.

The following instructions apply to resetting a password in PostgreSQL, whether or not it is installed as a part of SoftActivity software. The only difference in the service name SapgSrv15, or SapgSrv for SoftActivity and something like postgresql-9.6, postgresql-x64-15 if installed from Postgres website.

To reset PostgreSQL database password in SoftActivity product, follow these steps:

  1. Open Database tab in TS Monitor or Activity Monitor settings, click Check Connection to verify connection settings:
  2. Try the password used to open SoftActivity Monitor or TS Monitor. If it’s still not accepted, you can reset the password for the database.
  3. Click About tab, click PostgreSQL config files link to open the database’s pgdata folder.
  4. Back up pg_hba.conf there found there.
  5. Open pg_hba.conf file in Notepad, find the following lines at the bottom of the file:
    host all all 127.0.0.1/32 scram-sha-256
    host all all ::1/128 scram-sha-256

    and replace with:

    host all all 127.0.0.1/32 trust
    host all all ::1/128 trust


    – Uncomment the lines if needed by removing a leading # character.

    Warning: this modification allows any user to connect to the database from the local computer without any password authentication! These lines must be reverted or commented out later!
  6. Restart PostgreSQL server by restarting SapgSrv15 service in Windows Services or from Command Line:
    sc stop SapgSrv15
    sc start SapgSrv15
  7. Make sure that SapgSrv15 service has started and is in Running state. If pg_hba.conf file has been incorrectly formatted after editing, the service might not start. Check Event Log for error messages from PostgreSQL source.
  8. Open Command Prompt in this folder:
    "C:\Program Files\SoftActivity\Activity Monitor\postgres15\bin" or
    "C:\Program Files\SoftActivity TS Monitor\postgres15\bin"
  9. Run this command from Command Prompt:
    psql -h localhost -U softactivity -d postgres

    , where softactivity: user name used for connection
    postgres – database name
    This command should not ask for password and will connect you to the database from the command line.
  10. Enter the following command that changes the password for user softactivity (replace my_secure_password with an actual unique and strong password):
    ALTER USER softactivity with password 'my_secure_password';
    and press Enter to execute.
    Note: make sure you don’t miss ; character at the end
    Type \q and press Enter to exit psql
  11. Important: Restore pg_hba.conf to its original state, or revert the lines your modified earlier. Restart SapgSrv15 to apply the changes.
  12. Enter your new password on Database tab in Settings and click Check Connection to verify that it’s accepted now.