Restoring a Qlik Sense site
Consider the following when restoring a site:
- Qlik Sense software
- Repository database (QSR): The database contains all configuration data for the site.
-
SenseServices database (if you have a linked cloud environment)
-
QSMQ database (if you have a linked cloud environment)
-
Licenses (optional, license assignments restored from LBS after applying license key - SGK)
- Certificates for the Qlik Sense services: The certificates are used to encrypt the traffic between the services and the users. Make sure to backup the certificates in order not to lose any encrypted data (for example, passwords for data connections).
- Log data
- Application data: The data models in the Qlik Sense apps.
- Any content that supports the apps (for example, QVD files)
-
If you want to restore the site to a central node with the same hostname, see Restoring a Qlik Sense site to a machine with the same hostname.
If you want to restore the site to a central node with a new hostname, see Restoring a Qlik Sense site to a machine with a different hostname.
Restoring a Qlik Sense site to a machine with the same hostname
When performing the procedure below you must log in using an account that had the Root Admin role when the site was backed up. If you log in using a local admin account and the machine name is different, your permissions will not follow through.
Do the following:
- Restore the certificates used to secure the Qlik Sense services.
- Install Qlik Sense on the computer where you plan to restore.
- Start the Qlik Sense Repository Database (QRD).
- Restore the repository database:
Open a Command Prompt with administrator privileges in Microsoft Windows.
Navigate to: cd "%ProgramFiles%\Qlik\Sense\Repository\PostgreSQL\<database version>\bin"
Run the following command to restore the repository database on a clean server:
pg_restore.exe -h localhost -p 4432 -U postgres -d QSR "c:\QSR_backup.tar"
pg_restore.exe -h localhost -p 4432 -U postgres -d SenseServices "c:\SenseServices_backup.tar"
pg_restore.exe -h localhost -p 4432 -U postgres -d QSMQ "c:\QSMQ_backup.tar"
pg_restore.exe -h localhost -p 4432 -U postgres -d Licenses "c:\Licenses_backup.tar"
Information noteYou may need to adjust the path "c:\QSR_backup.tar" depending on where you backed up your database dump file.If running these commands on a server where a repository database may have been installed previously, you may get the following error messages. Note the name of affected database and adjust corrective commands accordingly. For example, for the "QSR" database you might get:
pg_restore: [archiver (db)] connection to database "QSR" failed: FATAL: database "QSR" does not exist
If you get this error, from the same location run following command:
createdb -h localhost -p 4432 -U postgres -T template0 QSR
Then run the restore command again.
pg_restore: [archiver (db)] Error while PROCESSING TOC
pg_restore: [archiver (db)] Error from TOC entry 185; 1259 134513 TABLE Apps qliksenserepository
pg_restore: [archiver (db)] could not execute query: ERROR: relation "Apps" already exists
If you get many errors like above, stop the restoration process and from the same location run following two commands, one after another:
dropdb -h localhost -p 4432 -U postgres QSR
createdb -h localhost -p 4432 -U postgres -T template0 QSR
Then run the restore command again.
-
Restore log and application data to the file share used for storage of log and application data.
- Restore any supporting content to its original location as required.
-
Start the Qlik Sense services. If the services are started manually, start them in the following order:
- Qlik Sense Service Dispatcher (QSD)
-
Qlik Sense Repository Service (QRS)
If the user running Qlik Sense services is not local administrator on the machine, you need to start Repository.exe from an elevated command prompt using the -bootstrap parameter.
- Qlik Sense Proxy Service (QPS), Qlik Sense Engine Service (QES), Qlik Sense Scheduler Service (QSS), and Qlik Sense Printing Service (QPR) in no specific order
The start-up order is important. During start-up the QRS must be able to contact the Qlik License Service, which is managed by the QSD. The other services are dependent on the QRS. The QSD must therefore be running when the QRS is started.
-
Try to access the QMC or the Hub to verify that the migration has been successful. Also, from the Qlik Management Console reload the monitoring apps to verify that your certificates have been installed correctly.
Information noteIf restoring a multi-node site with central node on a machine with a different hostname, all rim nodes must be reset, that is, you need to remove them and then add them again.
Restoring a Qlik Sense site to a machine with a different hostname
You can restore a Qlik Sense site to a machine with a host name that is different from the site that you backed up.
Perform the following steps on the target server machine, where you want to restore Qlik Sense.
Do the following:
- Restore the certificates used to secure the Qlik Sense services.
- Install Qlik Sense on the computer where you plan to restore.
- Start the Qlik Sense Repository Database (QRD).
- Restore the repository database:
Open a Command Prompt with administrator privileges in Microsoft Windows.
Navigate to: cd "%ProgramFiles%\Qlik\Sense\Repository\PostgreSQL\<database version>\bin"
Run the following command to restore the repository database on a clean server:
pg_restore.exe -h localhost -p 4432 -U postgres -d QSR "c:\QSR_backup.tar"
pg_restore.exe -h localhost -p 4432 -U postgres -d SenseServices "c:\SenseServices_backup.tar"
pg_restore.exe -h localhost -p 4432 -U postgres -d QSMQ "c:\QSMQ_backup.tar"
pg_restore.exe -h localhost -p 4432 -U postgres -d Licenses "c:\Licenses_backup.tar"
Information noteYou may need to adjust the path "c:\QSR_backup.tar" depending on where you backed up your database dump file.If running these commands on a server where a repository database may have been installed previously, you may get the following error messages. Note the name of affected database and adjust corrective commands accordingly. For example, for the "QSR" database you might get:
pg_restore: [archiver (db)] connection to database "QSR" failed: FATAL: database "QSR" does not exist
If you get this error, from the same location run following command:
createdb -h localhost -p 4432 -U postgres -T template0 QSR
Then run the restore command again.
pg_restore: [archiver (db)] Error while PROCESSING TOC
pg_restore: [archiver (db)] Error from TOC entry 185; 1259 134513 TABLE Apps qliksenserepository
pg_restore: [archiver (db)] could not execute query: ERROR: relation "Apps" already exists
If you get many errors like above, stop the restoration process and from the same location run following two commands, one after another:
dropdb -h localhost -p 4432 -U postgres QSR
createdb -h localhost -p 4432 -U postgres -T template0 QSR
Then run the restore command again.
-
Restore log and application data to the file share used for storage of log and application data.
- Restore any supporting content to its original location as required.
-
To launch Qlik Sense with the new hostname:
-
Open a Command Prompt with administrator privileges in Microsoft Windows.
-
Change the directory to the Repository installation path
Default path: "C:\Program Files\Qlik\Sense\Repository"
-
Execute the following command:
Repository.exe -bootstrap -standalone -restorehostname
Information noteThe parameter '-standalone' means that Repository runs as a normal executable process (as opposed to running as a service, and registering in Windows Service Manager). -
Start the Qlik Sense Service Dispatcher when the following message is displayed. If the Qlik Sense Service Dispatcher is not running, the hostname update will not complete.
[INFO] Entering main startup phase...
When the command has completed successfully check for errors in the logs and the following message is displayed:
Bootstrap mode has terminated. Press ENTER to exit..
-
-
Start the Qlik Sense services. If the services are started manually, start them in the following order:
-
Qlik Sense Repository Service (QRS)
If the user running Qlik Sense services is not local administrator on the machine, you need to start Repository.exe from an elevated command prompt using the -bootstrap parameter.
- Qlik Sense Proxy Service (QPS), Qlik Sense Engine Service (QES), Qlik Sense Scheduler Service (QSS), and Qlik Sense Printing Service (QPR) in no specific order
The start-up order is important. During start-up the QRS must be able to contact the Qlik License Service, which is managed by the QSD. The other services are dependent on the QRS. The QSD must therefore be running when the QRS is started.
-
-
Try to access the QMC or the Hub to verify that the migration has been successful. Also, from the Qlik Management Console reload the monitoring apps to verify that your certificates have been installed correctly.
Information noteIf restoring a multi-node site with central node on a machine with a different hostname, all rim nodes must be reset, that is, you need to remove them and then add them again.
For additional information on changing the hostname after installation, see Qlik Sense: Change hostname (and certificates) after an installation.