Restoring a Qlik Sense site

Consider the following when restoring a site:

  • Repository database: The database contains all configuration data for the site.
  • 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)

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.

Procedere come indicato di seguito:

  1. Restore the certificates used to secure the Qlik Sense services.
  2. Restoring certificates

  3. Install Qlik Sense on the computer where you plan to restore.
  4. Avviso: Make sure to deselect Start the Qlik Sense services when the installation has completed during the installation setup.
  5. Start the Qlik Sense Repository Database (QRD).
  6. Restore the repository database:
    1. Place the backed up repository database on the machine targeted for the restore.
    2. Open a Command Prompt with administrator privileges in Microsoft Windows.

    3. Run the following commands to restore the repository database (adjust the paths as needed):
      1. cd "%ProgramFiles%\Qlik\Sense\Repository\PostgreSQL\<database version>\bin"

      2. createdb -h localhost -p 4432 -U postgres -T template0 QSR

      3. If the command fails because a database already exists, run the following command and then repeat the createdb command:

        dropdb -h localhost -p 4432 -U postgres QSR

      4. pg_restore.exe -h localhost -p 4432 -U postgres -d QSR "c:\QSR_backup.tar"

  7. Restore log and application data to the file share used for storage of log and application data.

  8. Restore any supporting content to its original location as required.
  9. Start the Qlik Sense services. If the services are started manually, start them in the following order:
    1. 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.

      Services

    2. 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 order is important because the QRS is dependent on the QRD and the rest of the services are dependent on the QRS.

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. However, if the machine is a central node in a multi-node site, you need to slightly adapt the procedure as follows:

  • All rim nodes need to be reset, that is, you need to remove them and then add them again.
  • Run repository.exe -bootstrap -standalone -restorehostname from an elevated command prompt to start the Qlik Sense Repository Service (QRS). When QRS is up and running, restart the QRS without -restorehostname.
    See: Services
Nota: The parameter '-standalone' means that Repository runs as a normal executable process (as opposed to running as a service, and registering in Windows Service Manager).

When restoring your site, 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.

Backing up the current server

Perform the following steps on the server machine that you want to restore to a different server.

  1. Create a local folder called Backup or something similar to store the files you want to restore later. For example: C:\ProgramData\Qlik\Sense\Repository\Backup.
  2. In Qlik Management Console, go to the Certificates section and export new certificates using the FQDN of the new server. Ensure tht you include the private key and the certificates must be in the Windows format.

  3.  Backup your certificates using the Microsoft Management Console (MMC). For detailed steps, see Backing up certificates. On your original server, export the following certificates from the QMC to your Backup folder. Ensure that you export the private key.
    • client
    • root
    • server
  4. On the service cluster, open the your backup location QMC, Cluster Settings, copy the full UNC path of the QlikShare (the full path name including back slashes), for example \\<computer_name>\QlikShare
  5. In Windows, Services, stop all services, except the Qlik Sense Repository Database.

  6. Backup the QSR database. For detailed instructions, see Backing up a Qlik Sense site. Copy the database dump file to your backup folder.
  7. Copy all sub folders from the QlikShare (the path specified in the Service Cluster section of the QMC) to your backup folder.
  8. Copy your Backup folder from the current folder to the same location on your target machine.

Restoring to a machine with a different host name

Perform the following steps on the target server machine, where you want to restore Qlik Sense.

  1. Create a QlikShare folder on the target server computer. For example, create a folder called QlikShare on the C:\ drive.
  2. Move your backup folder and database dump file to your target server machine.
  3. Restore the the following backed up certificates from the old machine used to secure the Qlik Sense services:
    • client
    • root
    • server
    Use the MMC to import them to your target server. Ensure that you mark the certificates as exportable. For detailed steps, see Restoring certificates
  4. Install the same version of Qlik Sense on the computer where you plan to restore. Do not start the services until you have finished the configuration steps.
  5. Avviso: Make sure to deselect Start the Qlik Sense services when the installation has completed during the installation setup.
  6. Start the Qlik Sense Repository Database (QRD) service.
  7. Restore the backup copy of the repository database:
    1. Open a Command Prompt with administrator privileges in Microsoft Windows.

    2. 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"
      Nota: You may need to adjust the path "c:\QSR_backup.tar" depending on where you backed up your database dump file.
    3. If running this command on a server where a repository database may have been previously installed, you may get the following error message:

      pg_restore: [archiver (db)] connection to database "QSR" failed: FATAL: database "QSR" does not exist

      If you get this error, follow the steps below:

      1. Navigate to: cd "%ProgramFiles%\Qlik\Sense\Repository\PostgreSQL\<database version>\bin"
      2. Run createdb -h localhost -p 4432 -U postgres -T template0 QSR.
        If the command fails because a database already exists, you get the following error message: createdb: database creation failed: ERROR: database "QSR" already exists
      3. Run dropdb -h localhost -p 4432 -U postgres QSR to drop the database.
      4. Execute the createdb command again. createdb -h localhost -p 4432 -U postgres -T template0 QSR

  8. Restore the log and application data to the QlikShare folder.
  9. To launch Qlik Sense with the new hostname:

    1. Open a Command Prompt with administrator privileges in Microsoft Windows.

    2. Change the directory to the Repository installation path

      • Default path: C:\"Program Files"\Qlik\Sense\Repository
    3. Execute the following command:
      Repository.exe -bootstrap -standalone -restorehostname

      When the command has completed successfully check for erros in the logs and the following message is displayed:

      Bootstrap mode has terminated. Press ENTER to exit..

  10. Start the Qlik Sense services. If the services are started manually, start them in the following order:
    • Qlik Sense Service Dispatcher
    • Qlik Logging Service
    • Qlik Sense Repository Service
    • Qlik Sense Proxy Service
    • Qlik Sense Engine Service
    • Qlik Sense Scheduler Service
    • Qlik Sense Printing Service
  11. 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.