Skip to main content
Announcements
Qlik Data Gateway upgrade REQUIRED by September 15 READ MORE

How-to reset forgotten PostgreSQL password in Qlik Sense

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

How-to reset forgotten PostgreSQL password in Qlik Sense



During the installation of Qlik Sense, it is recommended to provide a password for the PostgreSQL database.
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 was 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. 
 

 

Resolution:


1. Stop the service called: "Qlik Sense Repository Database" (note: this will stop most Qlik Sense Services, as seen below)

     Before:
    User-added image

     After:
     User-added image

2. Open Notepad as an administrator (right-click on Notepad and select Run as Administrator)

3. From Notepad, click File > Open

4. Browse to C:\ProgramData\Qlik\Sense\Repository\PostgreSQL\9.6    (if "9.6" cannot be found then it's likely "12.5" which is what newer Qlik versions use)

5. Click on All Files (*.*) in the lower right corner dropdown of the dialog box
    User-added image
Note: Backup the files pg_hba.conf and postgresql.conf before making any changes!

5. Open the file pg_hba.conf

6. Change the METHOD from "md5" to "trust" in the both the IPv4 and IPv6 entries. There are four methods listed in total - only the first two need to be changed to trust:

     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

     NOTE: "trust" must be lowercase!
     If you use uppercase ("TRUST"), then the service will not start and attempts to make file backups will result in 0kb files when attempting to generate a database dump/backup.


7. Save the file and close it.

8. Start the service called: "Qlik Sense Repository Database" (example below). If this happens to start other dependent services as well, that is fine.

    User-added image

9. Launch a Command Prompt and go to C:\"Program files"\Qlik\Sense\Repository\PostgreSQL\9.6\bin

cd "C:\Program files\Qlik\Sense\Repository\PostgreSQL\9.6\bin"

10. Enter the following command

psql -h 127.0.0.1 -p 4432 -U postgres

     The following message should be displayed
     User-added image

11. From the postgres=# prompt, enter the following commands:
 

11a. Adjust the postgres user account (you must include the single quotes and the semicolon):
alter user postgres with encrypted password 'EnterYourNewPasswordHere';
The following message should be displayed
User-added image

11b. If v3.0.x and above, you must also adjust the qliksenserepository user account (you must include the single quotes and the semicolon):
alter user qliksenserepository with encrypted password 'EnterYourNewPasswordHere';
The following message should be displayed
User-added image

The passwords must be the same for both, when making changes. Once complete, close the Command Prompt window.
 
12. The following is required after changing the database passwords for postgres and/or qliksenserepository. You must inspect the Connection String afterwards to change the password listed inside the file(s) below to the new password that was just created. Also, verify that the rest of the entire connection string is correct. The settings in these files are what the Qlik Sense Repository Service uses to connect to the underlying database. Navigate to the following and update as needed:

When opening the Connection String Editor -- Right Click and RUN AS Administrator (or the changes will not save)
 
C:\Program Files\Qlik\Sense\Repository\Util\QlikSenseUtil
or
C:\Program Files\Qlik\Sense\Repository\Util\ConnectionStringEditor


NOTE 2: If using version 2.4 or older, these files may not exist, and as such no editing is required.

User-added image
 
13. Stop the Qlik Sense Repository Database service, and the "Repository Service" as well if it's also running (so they appear as below)

      User-added image
 
14. Navigate to C:\ProgramData\Qlik\Sense\Repository\PostgreSQL\9.6 and open pg_hba.conf and change the METHOD back from "trust" to "md5"

15. Start all Qlik services. It's common practice to start the "Repository Database", "Repository Service", and the "Service Dispatcher" services first before starting other services.

16. Download and open pgAdmin4 in order to connect to the Qlik database locally in order to verify that the password has been updated successfully.
 
For instructions, refer to articles:
 
 
Verification must be done to ensure the password was updated successfully (in both the command prompt and within the connection string of those files) before moving forward or else Qlik will begin to have issues and future upgrades will fail.
       
NOTE: after the change is made, you may find you cannot get into the QMC. Please review this Article Qliksenserepository password error in the event logs after changing the database service user passwo... for the possible solution.
 
 
Labels (1)
Comments
houssamely
Contributor
Contributor

Hello,

This procedure did not succeed for us (QS Aprilm 2020 Patch 3 ). We had to execute this fix : https://support.qlik.com/articles/Basic/Qliksenserepository-password-error-in-the-event-logs-after-c...

Can you add these steps to the procedure ?

Thank you for your work,

hmjason7
Contributor II
Contributor II

Has anyone else come across any issues?

I managed to implement all the steps but am unable to access the QMC or Hub.

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @hmjason7 - You may want to gather additional information on the issue you are seeing (error messages, screenprints) and post on our Qlik Sense Deployment forums for better visibility. 

 

cata_pli
Partner - Contributor III
Partner - Contributor III

You start the video saying there is no way to recover the password, and then, in step 12, you show us how we can see the old password 🙂

Much easier to recover, than to change it

piotr_kierul
Partner - Contributor III
Partner - Contributor III

@cata_pli  exactly!! 😂

Benoit_C
Support
Support

@cata_pli , this Step 12 will show you the qliksenserepository password only.

So if you don't remember super admin password (Postgres user) then it won't be enough. It works only if you have put the same password for qliksenserepository and Postgres.

gkkandukuri
Contributor
Contributor

Hi,

i am not able to see bin folder in below location. has any one come across this issue?

cd "C:\Program files\Qlik\Sense\Repository\PostgreSQL\9.6\bin"

 

Benoit_C
Support
Support

Hi @gkkandukuri,

What is your Postgres version ? 

Do you have a bundled Postgres Database or a Standalone ?

gkkandukuri
Contributor
Contributor

HI,

sorry i found the bin folder was looking in C drive instead of D drive

Version history
Last update:
‎2022-06-15 08:23 AM
Updated by: