Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More

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
tvolkmerwolf
Partner - Creator
Partner - Creator

Hi @Torsten_Kohrt ,

at first thanks to you for this information.


In preparation to help a customer with this I started to try  the scripts, but already with

 

C:\Program Files\Qlik\sense\DataPrepService\install\Configure-Service.ps1

I receive an error:

 

 

 

PS C:\Program Files\Qlik\sense\DataPrepService\install> .\Configure-Service.ps1 localhost 4432 qliksenserepository 9ar5on65$
DataPrepService configuration started.
WARNUNG: Skiping the database initialization. No superuser or password specified.
Creating schema 'dataprep_service'.
Invoke-Query : Ausnahme beim Aufrufen von "Start" mit 0 Argument(en):  "Das System kann die angegebene Datei nicht
finden"
In C:\Program Files\Qlik\sense\DataPrepService\install\install-utils\Postgres.ps1:56 Zeichen:12
+     $ret = Invoke-Query $command
+            ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-Query], MethodInvocationException
    + FullyQualifiedErrorId : Win32Exception,Invoke-Query

 

 

 

Sorry,  it's partially in German, but it literally says "File not found" when the Invoke-Query command is run.

Environment is QS Enterprise Nov 2022 (Patch 6)  on a Windows host.

Can you perhaps give a hint on this?

Many thanks in advance!

Torsten_Kohrt
Employee
Employee

@tvolkmerwolf 

 

Hello Thank you for your message please try a password without $ or @ and try again please. PowerShell cannot handle it the way you are trying.

tvolkmerwolf
Partner - Creator
Partner - Creator

Hi @Torsten_Kohrt ,

 

thanks for the answer, but that of course was a fantasie pw, my real PW does not have any special char. Nevertheless I get the error.

tvolkmerwolf
Partner - Creator
Partner - Creator

Hi @Torsten_Kohrt ,

it's actually line ~104 in the PSQL-Script Postgres.ps1 in the directory 

C:\Program Files\Qlik\sense\DataPrepService\install\install-utils

 which creates hte process object and then throws $process.Start() . Maybe the blanks in the filename pointing towards the psql.exe gives this behaviour, but so far I've not found on how to correct that.

Maybe this helps? If not, sorry for bothering...

tvolkmerwolf
Partner - Creator
Partner - Creator

Skip this please, I guess I found it ... forget to adapt the path to the PQSL binary .... Sorry !

DimoDataPerformance_Jérôme
Partner - Contributor
Partner - Contributor

Bonjour,

Avec la restriction des caractères avec QPI 1.3.0, la modification a bien fonctionnée pour moi. Quels sont les impacts sur l’utilisation de l’authentification SAML sur ce changement.

1- Changeur du mot de PASSE Postgres

2- Modification de la config via QlikSenseUtil

Dans l’Environnement de DEV, tous est  ok, sans ADFS

Environnement PROD, La QMC ne s’ouvre plus. Tous les services démarrent, mais j’ai des erreurs lors du test de la connexion avec  QlikSenseUtil

image.png

Le problème est-il lié a l'ADFS ou au changement de mot de passe ?

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @DimoDataPerformance_Jérôme 

Please review Qlik Sense - How to troubleshoot issue to access QMC and HUB on how to troubleshoot QMC access issues. If this does not help you resolve the issue, I recommend logging a support ticket to obtain assistance with your production environment. 

Translated:

Veuillez consulter Qlik Sense - How to troubleshoot issue to access QMC and HUB pour savoir comment résoudre les problèmes d'accès à QMC. Si cela ne vous aide pas à résoudre le problème, je vous recommande de créer un ticket d'assistance pour obtenir de l'aide sur votre environnement de production.

All the best,
Sonja 

tonyiantorno
Partner - Creator
Partner - Creator

Hello,

I have completed part 1 and 2 with no issues. However, once I complete the micro-services and reboot the server, my RIM node is offline and I can not redistribute the certificate. Even when uninstalling the RIM and then trying to distribute the certificate I get the pop up window of can't communicate with port 4444.

QS August 2022. This is in preparation to upgrade to PostgreSQL 12.x or 14.x.

 

Thanks,

Tony

aashok
Contributor III
Contributor III

Hi, I am also encountering the issue with the RIM Node. 

Also earlier I was following the link on 'how to reset the forgotten password'

https://community.qlik.com/t5/Official-Support-Articles/How-to-reset-forgotten-PostgreSQL-password-i...

and then I came across this page. 

I did follow the steps mentioned, but part 3 caused me the error,

like changing the connection string to micro services is not working for all of them, 

for eg;

C:\Program Files\Qlik\Sense\NotifierService\install\Configure-Service.ps1

particularly for those ps1 files inside the install folders.

Could help on this matter?

khai
Contributor II
Contributor II

I am getting the same error as Tvolkmerwolf and Aashok. I have already changed my powershell working directory to the respective folders, but getting that error for some of the folders.

How do I resolve the errors for:

D:\Program Files\Qlik\Sense\DataPrepService\install
D:\Program Files\Qlik\Sense\NLBroker\install
D:\Program Files\Qlik\Sense\NotifierService\install
D:\Program Files\Qlik\Sense\PrecedentsService\install

Spoiler
PS C:\Program Files\Qlik\sense\DataPrepService\install> .\Configure-Service.ps1 localhost 4432 qliksenserepository Qlikview321xyz
DataPrepService configuration started.
WARNUNG: Skiping the database initialization. No superuser or password specified.
Creating schema 'dataprep_service'..
..

 

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