How to move Qlik Sense database to standalone PostgresSQL database
The Qlik Sense Repository Database (QSR) can be moved to a standalone PostgreSQL instance not hosted on the same machine as other Qlik Sense Services. It is also possible to move an already existing QSR from a local Sense install, to a dedicated PostgresSQL database.
QlikSense September 2017 and up
Set up a postgresSQL database
Instructions for this might vary slight. Please refer to the Qlik Online Help for details. We recommend watching this video. For Sense 2018 and 2019 versions, you'll have to create SenseServices,QSMQ, Licenses, and QLogs (if needed) databases, exactly as you've created the QSR database. For more details visit Installing and configuring PostgreSQL on help.qlik.com
Simplified checklist of steps:
Download a valid version of postgresSQL. For Sense June 2017 and up, 9.6.x is required, from November 2019 version 11.5.x as well. Review the system requirements of your version before proceeding.
Install based on instructions found on the Qlik Online Help for Qlik Sense; select the version you are running on then select from Menu , Deploy - Qlik Sense installation - Installing and configuring PostgreSQL.
Depending on the version, you need to backup different databases, on the current Qlik Sense central node hosting the Qlik Sense Repository Database service, follow the backup instructions to obtain a database copy of each Qlik Sense Database Present . Example for February 2021 you need to backup the databases reported in section "Installing and configuring PostgreSQL"; referring to the Help site these are : QSR , QSMQ , SenseServices , Licenses , if configured QLogs
On the dedicated remote postgresSQL host, perform a restore of the backed up Databases of previous point.
Changing the Connection String to QSR and QSMQ Database
On the Qlik Sense central node, all services but the Qlik Sense Repository Service are shut down.
Open QlikSenseUtil. By default, this will be installed in: C:\Program Files\Qlik\Sense\Repository\Util\QlikSenseUtil\QlikSenseUtil.exe
Open the Connection String Editor and Read the current configuration, decrypting the current data.
Replace all mentions of the current database hostname. In our example, the new database resides on 172.16.16.103. Instead of an IP you can also use the FQDN of the db server.
You need to repeat this step for the sections <add name="QSMQ" and <add name="postgres"
Hit Save Value in config file encrypted, committing any changes.
Changing the Connection String to SenseServices Databases.
Check that Qlik Sense Repository Database doesn't start (confirms [SC] ChangeServiceConfig SUCCESS ).
Remove the (local) Qlik Sense Repository Database
Find the most recent PostgreSQL.msi in C:\ProgramData\Package Cache\ and remove it. This removes the service but no old local database data. This is needed to prevent issues on future upgrades of Environment. You can find the precise folder with this command:
The folder containing PostgreSQL.msi will be revealed. Right click on the PostgreSQL.msi file and select uninstall from the menu.
Restart the Qlik Sense Repository Service and check that Qlik Sense Repository Database doesn't start (confirms [SC] ChangeServiceConfig SUCCESS )
Start all remaining Sense Services
Progress on the startup sequence (including the connection to the new database) can be tracked in the _System_Repository log files located in C:\ProgramData\Qlik\Sense\Log\Repository\Trace
In Multi-node scenario you need to repeat steps "Changing the Connection Strings toDatabases" on all Rim nodes; if required and configured "Update the Qlik Logging Service Connection String" .
This article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.