Skip to main content
Announcements
New: No-code data prep in Qlik Cloud Analytics™ TAKE A TOUR

How to take Backup and Restore Qlik Alerting MongoDB Database

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Rakesh_HB
Support
Support

How to take Backup and Restore Qlik Alerting MongoDB Database

Last Update:

Jan 31, 2025 4:50:27 AM

Updated By:

Sonja_Bauernfeind

Created date:

Jan 31, 2025 4:50:27 AM

This article documents the steps to backup and restore a Qlik Alerting instance. 

Prerequisites

Backup Steps

  1. RDP to the server as an administrator user
  2. Open a command window as an administrator
  3. Enter the following to change directory:
    cd "C:\Program Files\MongoDB\Server\<VERSION>\bin"
    If you are using a newer version of MongoDB, or it is located in a different location such as a D:\ drive, then please adjust this accordingly.
  4. Enter the following command, where Backup Name is the identifier for your backup:
    mongodump --db=qlikalerting --out="Backup Name"
    This will create a new folder in the C:\Program Files\MongoDB\Server\<VERSION>\bin folder called "Backup Name" and will export all of the data from the database into JSON format files.
  5. Zip the new folder and store it for safekeeping

To automate the process:

Use the following code, with adjustments made where needed for your environment.

 

 off
setlocal

rem Get the current date and time for versioning
for /f "tokens=1-3 delims=/ " %%a in ('date /t') do set dt=%%c-%%a-%%b
for /f "tokens=1-2 delims=: " %%a in ('time /t') do set tm=%%a-%%b

rem Combine date and time for the backup name
set BackupName=Backup_%dt%_%tm%

cd "C:\Program Files\MongoDB\Server\4.4\bin"
mongodump --db=qlikalerting --out="%BackupName%"

pause

 

An example of the output folder name will be: Backup_21-Mon-10_09-51

Make sure to update the MongoDB version as needed. In this example script, the version is '4.4'.

The information in this article is provided as-is and is to be used at your own discretion. Depending on the tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.

Restore Steps

  1. RDP to the server as an administrator user
  2. Open a command window as an administrator
  3. Enter the following to change directory:
    cd "C:\Program Files\MongoDB\Server\<VERSION>\bin"
    If you are using a newer version of MongoDB, or it is located in a different location such as a D:\ drive, then please adjust this accordingly.
  4. Move your backup to a location that is easy to identify and unzip the file so the folder is located here, for example, D:\backups\Backup Name
  5. Enter the following command, where Backup Name is the identifier for your backup:
    mongorestore "D:\backups\Backup Name"

 

Troubleshooting

You must provide the path to the qlikalerting folder, not the path where the .json and .bson files are located. Here, qlikalerting is the backup folder name.

Example of a wrong path with the resulting error:

qlik alerting wrong path for restore.png

Example with the correct path and successful message:

Based on the above example screenshot, the correct path would be:

>mongorestore "C:\backups"

qlik alerting correct path for restore.png

 

Environment

  • Qlik Alerting

 

Related Content

Labels (1)
Version history
Last update:
Friday
Updated by: