Qlik Sense upgrade to November 2022 fails with "An existing standalone PostgresSQL v 12 database has been detected"
After using the Qlik PostgreSQL Installer version 1.1 (QPI) to upgrade an existing 9.6 PostgresSQL to 12.5 in the May 2022 or August 2022 release, upgrading to Qlik Sense Enterprise on Windows November 2022 release may fail with the following error message.
An existing standalone PostgreSQL v 12 database has been detected in: C:\ProgramData\Qlik\Sense\Repository\PostgreSQL \12.5 with the same installation path as the embedded Qlik Sense PostgreSQL database. This will cause problems when upgrading the current installation. Please cancel the setup and install the PostgreSQL v 12 standalone database with a different path or remove the database before installing Qlik Sense.
Disclaimer:The following code provided below is an example and might need to be rewritten to meet your expectation in your environment.
We need to move the upgraded database and the binary files for the database into a different folder. The newer version of the QPI (version 1.2 and above) supports custom folders and will prevent this from happening.
Modify the image path to "C:\Program Files\PostgreSQL\12\bin\pg_ctl.exe" runservice -N "postgresql-x64-12" -D "C:\Program Files\PostgreSQL\12\data" -w
Move the folder "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\12.5" to "C:\Program Files\PostgreSQL\12\"
Move the folder "C:\ProgramData\Qlik\Sense\Repository\PostgreSQL\12.5" to "C:\Program Files\PostgreSQL\12\data"
Start the postgresql-x64-12 service
Start the upgrade to November 2022 again and the warning message is gone.
A PowerShell script for the same can be found here.
The Qlik Postgres Installer in the early version could only install into the same directory which the Qlik Sense installation would use for an embedded PostgreSQL database. This lead to problems on the upgrade to the November release.