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 change the Qlik Sense Enterprise on Windows PostgreSQL password

100% helpful (2/2)
cancel
Showing results for 
Search instead for 
Did you mean: 
Torsten_Kohrt
Employee
Employee

How to change the Qlik Sense Enterprise on Windows PostgreSQL password

Last Update:

Jul 3, 2024 9:59:43 AM

Updated By:

Sebastian_Linser

Created date:

Mar 8, 2023 9:12:59 AM

During installation, Qlik Sense Enterprise on Windows prompts you to choose a password for its PostgreSQL repository. This password can be changed. The process is split into three steps.

 

1. Changing the PostgreSQL password in the database

  1. Download and install pgAdmin 4
  2. Connect to your Qlik Sense PostgreSQL database:

    1. Host name/address: localhost (if the database has been installed on the local machine)
    2. Port: 4432
    3. Maintenance database (*): postgres
    4. Username: postgres
    5. Password: Your current password


      (*) Note that the maintenance database name may differ if this was not a standard installation and changes were made during setup. Consult your configuration file if necessary. 

  3. Right Click on the postgres database.
  4. Click Query Tool

    PGAdmin Query Tool.png

  5. Copy the following queries into the Query Tool, replacing Example Password with your new password:

    ALTER USER postgres WITH PASSWORD 'Example_Password';

    ALTER USER qliksenserepository WITH PASSWORD 'Example_Password';

    change the password in PgAdmin.png

  6. Run the Query

This has changed the password in the database itself. We will now move on to modifying the connection strings used by the database.

 

2. Changing the Connection String to QSR and QSMQ Database

For this step, we will need the QlikSenseUtil stored in C:\Program Files\Qlik\Sense\Repository\Util\QlikSenseUtil\.

It has to be repeated on all nodes.

  1. On the Qlik Sense central node, stop all services except the Qlik Sense Repository Database Service 
  2. Open QlikSenseUtil 
  3. Open the Connection String Editor and Read the current configuration. This decrypts the current data. 
  4. Change the Password in the following two connectionStrings:
    • QSR
    • QSMQ

      Connection String Editor in the QlikSenseUtil.png

  5. Hit Save Value in config file encrypted

    Save Value in config file encrypted.png

We have now changed the connection strings to the QSMQ database and the QSR database.

 

3. Changing the Connection String for Micro-Services 

Qlik Sense has introduced micro-services, all of which will require to have their connection strings modified.

To make changing them easier, we have provided a Configure-Service.ps1 for each. They can be located in:

Always run PowerShell as administrator.
  • C:\Program Files\Qlik\Sense\Licenses\Configure-Service.ps1
  • C:\Program Files\Qlik\Sense\NotifierService\install\Configure-Service.ps1
  • C:\Program Files\Qlik\Sense\AppDistributionService\Configure-Service.ps1
  • C:\Program Files\Qlik\Sense\HybridDeploymentService\Configure-Service.ps1
  • C:\Program Files\Qlik\Sense\MobilityRegistrarService\install\Configure-Service.ps1
  • C:\Program Files\Qlik\Sense\PrecedentsService\install\Configure-Service.ps1
  • C:\Program Files\Qlik\Sense\NLAppSearch\install\Configure-Service.ps1
Depending on your version of Qlik Sense, the above list may not be complete. Review C:\Program Files\Qlik\Sense\ for any additional micro-service folders that include a Configure-Service.ps1. You can obtain a list of all relevant folders by running the following command in a command prompt: dir /s configure-service.ps1

 To update your password using Configure-Service.ps1:

  1. Open an elevated Powershell and change the directory to (for example with the license service) C:\Program Files\Qlik\Sense\Licenses

  2. Run the Configure-Service.ps1 script as follows, providing the correct hostname and the new password:

    .\Configure-Service.ps1 YourPostgresHostName 4432 qliksenserepository ExamplePassword

    You may receive the following: WARNING: Skipping the database initialization. No superuser or password specified. 

    This is expected. It does not indicate that the password change has failed.

  3. Repeat these steps for the remaining micro-services. Your PostgreSQL password has now been changed.

If you have not installed Qlik Sense in its default location or have upgraded PostgreSQL, the Configure-Service.ps1 script must be adjusted for each microservice.

Example for changing the install path:

Before:

[string]$senseInstallPath = "$env:ProgramFiles\Qlik\Sense"

After:

[string] $senseInstallPath = "D:\Program Files\Qlik\Sense",

Example for changing the PostgreSQL version:

Before:

[string]$postgresHome = "$senseInstallPath\Repository\PostgreSQL\9.6"

After:

[string]$postgresHome = "$senseInstallPath\Repository\PostgreSQL\12.5"

or 

[string]$postgresHome = "$senseInstallPath\Repository\PostgreSQL\14"

Depending on the PostgreSQL version under C:\Program Files\Qlik\Sense\Repository\PostrgreSQL\

 

Micro-Services Alternative method:

The alternative is to find all the PowerShell files programmatically.

Note that in our example we assume the default install directory and the default port of 4432. You may need to adapt the script accordingly.

# Set the Installation Directory for Qlik Sense
$installDir = 'C:\Program Files\Qlik\Sense\'
# Specify the new password for the qliksenserepository account
$password = 'MyNewPassword'
$files = Get-ChildItem -Path $installDir -Include Configure-Service.ps1 -Recurse
foreach ($file in $files) {
    $ScriptToRun=$($file.FullName)
    &$ScriptToRun localhost 4432 qliksenserepository $password
}

 

 

 

Labels (1)
Comments
Sonja_Bauernfeind
Digital Support
Digital Support

Hello @khai let me look into this for you.

All the best,
Sonja 

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @khai 

The previous two users were engaged in support tickets. One is still under investigation, and one is resolved, though I believe the root causes of both differ.

As for your specific question:

Can you define what error besides the warning you are getting? I've checked with our subject matter experts, and the warning you received is expected for some of the services and should not lead to problems.

In the screenshot below is one warning (the one you received), which can be dismissed, and one error (caused by the script being run after the database had been upgraded using QPI), which is an actual error requiring action.

Sonja_Bauernfeind_0-1696578675079.png

If you only receive the warning, can you clarify what other symptoms or errors are logged? 

All the best,
Sonja 

PS: I will be updating the article with this information as soon as possible.

 

khai
Contributor II
Contributor II

Hi @Sonja_Bauernfeind , I am changing the password before the QPI is installed, because the current password contain the restricted special characters. Noted, I have created a support case 00116779 with the error screenshots.

Version history
Last update:
‎2024-07-03 09:59 AM
Updated by: