Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!

How to reset forgotten PostgreSQL password in Qlik Sense Enterprise on Windows

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Bjorn_Wedbratt
Former Employee
Former Employee

How to reset forgotten PostgreSQL password in Qlik Sense Enterprise on Windows

Last Update:

Oct 3, 2023 6:45:28 AM

Updated By:

Troy_Raney

Created date:

Oct 13, 2014 6:56:49 AM




A password is provided during the installation of Qlik Sense Enterprise on Windows. Should you forget this password, there's no way to retrieve it; however, it is possible to reset the password by following the steps below. 

If after the procedure is completed errors are logged of a wrong password, see Qliksenserepository password error in the event logs after changing the database service user passwo... for further information. 

  1. Stop all the Qlik Sense services

    Verify that the Qlik Sense Repository Database service (or postgresql-x64-xx if the database is not a bundled install and/or was installed using QPI) is stopped.

    new service postgresqlx6412.pngqlik sense repository database service.png

  2. The next step will require modifying the pg_hba.conf and postgresql.conf files. We will swap the currently active authentication method to trust, allowing us to connect without a password. 

    Before modifying the file, take a backup of both files.

    File locations:

    Default (bundled):  

    C:\ProgramData\Qlik\Sense\Repository\PostgreSQL\12.5

    Alternative (unbundled, custom install):

    C:\Program Files\PostgreSQL\12.5\data

    *12.5 refers to the PostgreSQL version. Adjust accordingly depending on what version is installed.  

  3. Open a text editor (such as Notepad or Notepad++) As Administrator and browse to the .conf file location. 

    If you cannot see the .conf files, switch the file view to All Files (*) or All Types, depending on your editor.

    all files or all types.png

  4. Open pg_hba.conf

  5. Change the METHOD from md5 (alternative: scram-sha-256) to trust 

    Only the first two lines for IPv4 and IPv6 entries must be changed. trust must be lowercase.

    Original:
    # 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


    Updated:

    # TYPE  DATABASE        USER            ADDRESS                 METHOD
    
    # IPv4 local connections:
    host    all             all             127.0.0.1/32            trust
    # IPv6 local connections:
    host    all             all             ::1/128                 trust
  6. Save the file, close it

  7. Start the Qlik Sense Repository Database (or postgresql-x64-xx).

  8. Launch the Windows Command Line As Administrator.

  9. In the command line, navigate to the PostgreSQL bin folder
    cd "C:\Program files\Qlik\Sense\Repository\PostgreSQL\12.5\bin"
    *12.5 refers to the PostgreSQL version. Adjust accordingly depending on what version is installed.  

  10. Run psql to connect to the database: 
    psql -h 127.0.0.1 -p 4432 -U postgres​
    The response will provide the postgres=# prompt, which we will use to change the passwords.

    postgreqs prompt.png

  11. Proceed from the postgres=#

    The Qlik Sense PostgreSQL database has two users:

    postgre: the super user
    qliksenserepository: the service user; if the database was installed manually or set up with QPI, this may be the only user set up

    The passwords must be the same for both. 

    1. Change the postgres user account (you must include the single quotes and the semicolon):
      alter user postgres with encrypted password 'EnterYourNewPasswordHere';​

      Response:
      response postgre user change.png

    2. Change the qliksenserepository user account (you must include the single quotes and the semicolon):
      alter user qliksenserepository with encrypted password 'EnterYourNewPasswordHere';
      Response:
      response qliksenserepository user change.png

  12. Close the command prompt.

  13. Adjust the connection string using QlikSenseUtil

    1. Open QlikSenseUtil (C:\Program Files\Qlik\Sense\Repository\Util\QlikSenseUtil)

    2. Open the Connection String Editor tab

    3. Click Read

    4. Adjust the password

    5. Click Save Value in config file encrypted

      qliksenseutil.png


  14. Change the Connection Strings for Micro-Services as per Changing the Connection String for Micro-Services.
  15. Stop the Qlik Sense Repository Database (or postgresql-x64-xx).

  16. Revert the changes done to the pg_hba.conf file, changing back  METHOD from trust to md5 (alternative: scram-sha-256).

  17. Start all services (Manual start and stop order of Qlik Sense services).

This concludes the required steps.

To verify if the password was correctly changed, you can either run psql again, connect with the PGAdmin, or review the Qlik Sense Repository log for success messages on boot.

If after the procedure is completed errors are logged of a wrong password, see Qliksenserepository password error in the event logs after changing the database service user passwo... for further information. 

 


      
Labels (1)
Comments
Sonja_Bauernfeind
Digital Support
Digital Support

Hello @p_verkooijen 

I've updated/rewritten the article and linked it to the second article at the appropriate step. Thank you for alerting us! 

The video is under review and will be updated or slightly modified.

All the best,
Sonja 

Version history
Last update:
‎2023-10-03 06:45 AM
Updated by: