This article contains steps on how to do backup and restore the Qlik Sense Enterprise on Windows (QSEoW) site.
For full instructions on how to backup and restore a Qlik Sense site, see the online help under Backup and restore Qlik Sense Enterprise on Windows.
For sole database backup information article can be found here: How to backup PostgreSQL database in Qlik Sense
Backup and Restore Targets:
- Qlik Sense Repository Database
- Certificates
- Apps used by Qlik Sense
- The Repository Content used by Apps
Environment
- Qlik Sense Enterprise on Windows, June 2017 and up
These steps are provided as-is based on latest version available of Qlik Sense product at the time of writing and/or last update to the article. Please make sure to cross-reference these steps with the official documentation for your product version under Backup and restore Qlik Sense Enterprise on Windows.
Step 1: The Qlik Sense Repository Database
Backing up Qlik Sense Repository Database:
Downtime is required
- Stop all Qlik Sense Services except for "Qlik Sense Repository Database" on Windows Server manager (services.msc)
- Create c:\backupfolder
- Open CMD.ext as administrator
- Go to "bin" folder
Note: the directory name will reflect your postgre version (9.6, 11.x, etc..).
cd "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\9.6\bin"
- Take PostgreSQL backup. There will be a password prompt for the postgres account.
Note: If postgres db password is unknown, see How-to reset forgotten PostgreSQL password in Qlik Sense
.\pg_dump.exe -h localhost -p 4432 -U postgres -b -F t -f "c:\backup\QSR_backup.tar" QSR
- Check for any errors/warnings and that the backup file size after command execution finishes. It should not be 0kb.
Restoring Database (PostgreSQL):
Option 1: Restoring on the same machine (PostgreSQL)
- Create c:\backup folder
- Move the backup file (Repository dump) into c:\backup
- Stop all Qlik Sense services
- Start the Qlik Sense Repository Database only
- Open up cmd.exe as an administrator
- Go to PostgreSQL folder
Note: the directory name will reflect your postgre version (9.6, 11.x, etc..).
cd "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\9.6\bin"
- Drop the current database
.\dropdb.exe -h localhost -p 4432 -U postgres QSR
- Create a new template database
.\createdb.exe -h localhost -p 4432 -U postgres -T template0 QSR
- Restore database
.\pg_restore.exe -h localhost -p 4432 -U postgres -d QSR "c:\backup\QSR_backup.tar"
- Restart Windows OS and All Qlik Sense services
For further reference, consult the Qlik Sense Help Site for your respective version.
Option 2: Restoring on a different machine (PostgreSQL)
- Create c:\backup folder
- Put the backup file (Repository dump) into c:\backup
- Install Qlik Sense of a new machine
- While the Qlik Sense installation process, uncheck the check box to start services after installation in case extra configuration is needed before Qlik Sense initializes.
- Once the installation has finished, start the Qlik Sense Repository Database only
- Move the PostgreSQL backup file (c:\backup\QSR_backup.tar) into a new server. from old server to local disk on the new server
- Go to the "bin" folder
- Open CMD.exe as administrator
- Go to PostgreSQL directory
cd "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\9.6\bin"
- Create the template database
Note: If database has already been created on a new machine, you need to delete the current database first. Otherwise the error "createdb: database creation failed: ERROR: database "QSR already exists" will be displayed.
Run the following commands in order to drop and then create the database:
- Drop database (if one exists):
.\dropdb.exe -h localhost -p 4432 -U postgres QSR
- Create temp database:
.\createdb.exe -h localhost -p 4432 -U postgres -T template0 QSR
- Restore the database by running the following command:
.\pg_restore.exe -h localhost -p 4432 -U postgres -d QSR "c:\Backup\QSR_backup.tar"
- Change directory to the Repository installation folder:
cd "C:\Program Files\Qlik\Sense\Repository"
- Start the repository service with the two distinct commands:
.\repository.exe -standalone -restorehostname
- When QRS is up and running, restart the QRS without -restorehostname.
- If a new share path is going to be used then:
- Open QlikSenseUtil.exe (default location C:\Program Files\Qlik\Sense\Repository\Util\QlikSenseUtil\)
- Click Connect to database and enter valid credentials for the postrgres or qliksenserepository user
- Optionally, changing machine name in database:
Note: The LocalConfigs table has been removed as of Qlik Sense Feburary 2019 release and newer
- Restart Windows OS and all Qlik Sense services
- Important: If PostgreSQL has been migrated with a different Hostname (Machine name), All functions of QMC are disable and become gray out due to missing RootAdmin role. In order to resolve this issue. Please refer to this article How To Allocate RootAdmin Role To UserID After Qlik Sense Migration -QMC became Gray Out
Step 2: Certificates
Backing up The Certificate
Please refer to the Backing up Certificates Help site documentation for details and verify that the information matches your current version.
Restoring The Certificate
Please refer to the Restoring certificates Help site documentation for details and verify that the information matches your current version.
Step 3: Apps used by Qlik Sense
Backing up the Apps used by Qlik Sense
- Check "CLUSTER SETTINGS" in Qlik Management Console (QMC)
These can be found in the QMC in CONFIGURE SYSTEM >> Service cluster
- Confirm the Share path:
- Copy the Apps folder for backup.
Restoring Apps used by Qlik Sense:
- Copy and paste all sub-folders from the UNC root specified in the Service Cluster Section in the QMC on the old server into a newly configured UNC path for the new server
- Move or copy the backed Apps up into the "Share" folder in a new Qlik Sense machine.
- If path of Shared folder need to be changed, Please follow this article How to change the share path in Qlik Sense June 2017 or higher
Step 4: The Repository Content used by Apps
Backing up the Repository Content used by Apps:
Normally, It is similar to the section for apps, the path where these files live is in the StaticContent folder on the Share path.
Restoring the Repository Content used by Apps:
- Go to the Service cluster tab "QMC >> Service cluster "
- Enter in the root, app folder, static content folder, connector folders and archive log folders and press save
Related Content
Restoring a Qlik Sense site to a machine with a different hostname