As a business requirement of developers wanting to take advantage of new features in Qlik Enterprise Manager (QEM); we had to upgrade our system from 2021.05 to 2022.11.
This was not a smooth process and encountered several issues on the way.
First Attempt – Straight Upgrade
Simple to upgrade?
Just download the latest installer from Qlik’s website and kick it off?
Unfortunately when I gave developers keys to our dev QEM box to do the upgrade before Christmas as I was busy with other tasks.
They gave it a go without a backout plan.
Couple of days later I tried logging into the QEM console and couldn’t get on.
The AttunityEnterpriseManager service kept restarting every minute and the following errors were in the C:\Program Files\Attunity\Enterprise Manager\data\logs\EnterpriseManager.log
[START: 2023-03-01 09:40:18 Attunity EnterpriseManager Version: 2022.11.0.335]
1 2023-01-02 09:40:18 [Command ] [INFO ] Executing ServiceRunCommand command.
6 2023-01-02 09:40:19 [Host ] [INFO ] Setting up web host
6 2023-01-02 09:40:20 [Host ] [INFO ] The server will listen on the following location: http://xxxxxxx.xxx.xxx/attunityenterprisemanager
6 2023-01-02 09:40:20 [Host ] [INFO ] The server will listen on the following location: https://xxxxxx.xxx.xxx/attunityenterprisemanager
6 2023-01-02 09:40:20 [Host ] [ERROR] Object reference not set to an instance of an object.
6 2023-01-02 09:40:20 [Host ] [INFO ] Stopping service on error...
I tried the usual desperation tricks of restarting the service and then restarting the box.
In the end I had to uninstall QEM and reinstall 2021.05 as there was no backout plan.
The developers were then subsequently banned from doing anymore work on the QEM upgrade
Second attempt – Two jump upgrade
Next attempt was upgrading to 2022.05 and then jumping to 2022.11.
This time I took a backup of C:Program FilesAttunityEnterprise Managerdata so I could easily backout the change if I had problems.
The upgrade from 2021.05 to 2022.05 went smoothly; but when jumping from 2022.05 to 2022.11 the same error occurred.
I then raised a case with Qlik and also posted on their forum asking if anyone else had come across this problem.
Final Success
With help from Qlik support we developed a upgrade work around. Qlik said that there is a patch in the works as other users have had the same problem.
If you follow along – note that this method might differ for your system. In the three upgrades I have done internally; they all differed slightly.
Make sure you TEST and HAVE A BACKOUT PLAN
Upgrade Perquisites
This upgrade was done on a Windows 2019 server.
You will need:
- Admin rights to QEM’s server
- Licenses for QEM and Analytics
- Username/Password that AEM connects to the analytics database
- Privilege user account for to the analytics database
- Password for the user that you use to connect QR nodes to QEM
- A SQLite database client
- Handy to have – an editor that can validate json format
Method
- Log on to QEM console
- For each server under the server tab – Right click and go to “Stop Monitoring”
- Remote desktop to the QEM server
- Stop the AttunityEnterpriseManager service
- Back up C:\Program Files\Attunity\Enterprise Manager\data
- Run the upgrade to QEM 2022.05
- Once the upgrade is done; log onto QEM and ensure that version 2022.05 is working correctly
- Back up C:Program FilesAttunityEnterprise Managerdata again
- Stop the AttunityEnterpriseManager service again
- Run following command from the command line:
cd "C:\Program Files\Attunity\Enterprise Manager\bin"
aemctl repository export -f C:\temp\qem_repo_202205.json -w - Script out the postgres database with the following commands:
cd C:\Program Files\PostgreSQL10\bin
pg_dump -U <username> -s -C -c <analyticdbname> > C:\temp\analyticdbname.sql - Edit C:\temp\cdcanalyticsp.sql. Find and replace “<analyticdbname>” with “cdcanalytics_2022_11_p”. Save the file
- Run the following command to create a new temporary database on the postgres server:
psql -d postgres -U <username> -f C:\temp\cdcanalyticsp.sql
- This is where the problem lies in our instance. Open up C:tempqem_repo_202205.json
Find any code blocks with “type”: “AttunityLicense” in it and remove the whole code block.- On our dev system it was the section with “name”: “Replication Analytics”, but in prod it was section with “name”: “Replication Management”.
- You may need to experiment to find the correct section
- Go to Add/Remove and uninstall Enterprise manager
- Once remove – delete the the folder C:\Program Files\Attunity\Enterprise Manager\data
- Install QEM 2022.11. When prompted do not install Postgres
- Log into QEM and check that it is up and running correctly.
- Stop the AttunityEnterpriseManager service again
- Run the following command:
aemctl repository import -f C:\temp\qem_repo_202205_Fix.json -w
- Start the AEM service and check that it is running correctly
- Re-add the QEM and Analytics license
- Go to Settings -> Repository connections.
Enter in username password set the database as cdcanalytics_2022_11_p - Intialize the repository and start the connector
- Stop the AttunityEnterpriseManager service again
- Open up C:\Program Files\Attunity\Enterprise Manager\data\Java\GlobalRepository.sqlite in an SQLite editor
- Browse the table objects
Look for name = “AnalyticsConfiguration” and modify the json value “cdcanalytics_2022_11_p” to the original analytics database name - Save SQLite database
- Start the AEM service and check that it is running correctly
- Go to the server tab. Edit each server and re-add the password. Click on the button “Monitor this server’s tasks and messages”. Test the connection and click OK
- PVT QEM
If things go wrong
Backout process
- Uninstall QEM
- Delete the folder C:\Program Files\Attunity\Enterprise Manager\data
- Reinstall either QEM 2021.05 or QEM 2022.05
- Stop the AttunityEnterpriseManager service
- Restore the appropriate backed up data folder to C:\Program Files\Attunity\Enterprise Manager\data
- Restart the AEM service