
Backup Automation Map
Backup, Upgrade, and Recover Qlik Sense
Overview
There are couple of ways to go about creating backups of Qlik Sense server. We can either do it manually or automatically. Backing up Qlik Sense manually is a much longer, more error prone, and not at all scalable. So, we’re not going to be backing up Qlik Sense manually.
In this course, you will learn how to get a Qlik Sense server to backup itself. You will be able to implement this automation practice across every Qlik Sense server that you manage. You will be able to have an entire fleet of servers, all backing themselves up on a regular schedule. How cool is that?
Automating Qlik Sense server backups will ultimately free up your time to be able to do more exciting work and will enable more frequent backups which will reduce the risk of massive data loss. Plus, for me, and I’m assuming for you also, it’s just fun to do.
You’re about to find out how to get your company’s business intelligence infrastructure, potentially on a global scale, backup itself. You know how many people on this planet can do this kind of stuff? Not a whole lot, and you are about to be one of them. It’s a highly valuable skill and I hope you’re as excited to attain it as I’m excited to share it with you.
Let’s get started by getting an overview and a visual representation of what this automated process will look like.
3
POINTS
1
TAKEAWAY
MED
COMPLEXITY
01. Backup Automation Map
There’s a bunch of components that we will need to create and work with to get a Qlik Sense server to backup itself. To make the process easier to see and understand, I put together a Backup Automation Map. Here it is:
Let’s take a closer look at it. The first thing to notice is that there are six components or parts to this process:
Task Scheduler
PowerShell Scripts
PowerShell Modules
Credential Manager
Qlik Sense Server
Secure Backup Storage Locations
Task Scheduler
At high level, the automation process will consist of a set of tasks in Task Scheduler that will either be kicked off on a given schedule or based on completion of previous task.

Stop Qlik Sense Services Task will run on a given date and time; while remaining five tasks will each listen for previous task to successfully complete before they start running.
PowerShell Scripts
Each task that will be created in Task Scheduler will need a corresponding PowerShell script that will be executed and will complete the required task.

For example, we will need to create a PowerShell script that will:
Access SSL / TLS certificates from Microsoft Management Console.
Initiate export of each certificate.
And save exported certificates to a secure backup storage location.
There are commands that we can write in PowerShell that will do each of these steps.
We will also need a script that will stop Qlik Sense services, in proper order, and a script that will start Qlik Sense services once the backup process is complete. At high level, we will be using PowerShell to write scripts that will do each step of the backup process for us and then we will create a task in Task Scheduler to run each script.
PowerShell Modules
Microsoft built PowerShell to be able to interact with vast majority of Windows operating system components. However, they didn’t build a command for absolutely everything. One of the sets of commands that PowerShell doesn’t have out-of-the-box is the ability to save or retrieve passwords from Credential Manager.
Luckily, Microsoft along with gentleman named Justin Grote, one of Microsoft’s MVPs, put together these couple of modules that will allow us to interact with Credential Manager:

I will go deeper and provide more context and explanations of what exactly PowerShell Modules are, which ones we will need, how to install PowerShell modules, and more. For now, just know that we’ll need to get a couple of PowerShell modules that will enable us to communicate with Credential Manager to store and retrieve passwords that we will need to use for backup process automation.
Credential Manager
We need to use a password to access and backup PostgreSQL databases. When automating backup of repository databases, we will also need to use passwords for the same purpose. However, it is a big security risk to hardcode these passwords in a script. It’s never a good idea to have credentials laying around in plain text.
Likewise, since the goal is automation, we also don’t want to have to type in passwords every time backup process kicks off. It would be a huge step forward if we went from manually doing each step in the backup process to simply entering a password, but that’s still not ideal. Ideally, the entire backup process would run securely and autonomously.
This is where the Credential Manager comes to play. Credential Manager is a built-in application that comes with Windows operating systems, and it helps us avoid storing credentials in plain text. We will be using PowerShell to store and access a password stored in Credential Manager that we will need to access and backup PostgreSQL databases, users, indexes, etc.:

I will show you exactly how we will be using Credential Manager and the PowerShell commands for storing and accessing stored credentials in Credential Manager later on in the course. For now, just know that you’ll need a place to securely store passwords for accessing PostgreSQL and that we’ll be using built-in Credential Manager application for that purpose.
Qlik Sense Server
This is the machine that we will be backing up. It mainly consists of three parts that will need to be backed up:
SSL / TLS Certificates
PostgreSQL Server
Directories
These are the three core categories of components that were mentioned in Components to Backup lesson. Nothing new here.
Secure Backup Storage Locations
We’ll need a place to store the backups.

We’ve already covered where to store backups and access permissions for backup storage locations in Backups Storage and Security lesson. Take a look at that lesson if you need a refresher. Nothing new here either, just a reminder that you will need places to store backups.
The Backup Process
To summarize, the automated backup process will consist of PowerShell scripts that run on a schedule, thanks to Task Scheduler, and when executed, they access Credential Manager to get any passwords needed for backup process, then proceed to create backups of each certificate, database, and directory that needs to be backed up. These scripts will store each component in a secure backup location that you will choose and specify in backup scripts. When everything is backed up, the Start Qlik Sense Services task will run which will resume Qlik Sense server operations. Separately, we will also have a task and a PowerShell script that will take an initial set of backups, compress them to save on disk space, and copy them to additional backup storage locations for redundancy and extra security.
02. Is Automated Backup Process Different from Manual Backup Process?
Other than the fact that a server, instead of you, will be doing the backups, no. This is something important to recognize before we start. The automated process of backing up Qlik Sense will involve doing exact same steps in exact same order as the manual process for backing up Qlik Sense. Automated process will stop the services, backup certificates, backup PostgreSQL server, backup relevant directories, and then start Qlik Sense services once the backups are completed.
There’s no difference in what needs to be backed up or the order in which things are backed up. The difference is who will be doing the backup - you manually vs. your server automatically. That might seem obvious, but I wanted to mention that anyway in case you’re not 100% sure.
03. PowerShell for Qlik Sense
The last comment I’ll make before we start is that a huge part of Qlik Sense backup automation will be handled by PowerShell. PowerShell is, as the name suggests, very powerful and capable tool for automating Windows Server administration. In case you’re not familiar with PowerShell, I’ve put together several lessons in this course that are designed to:
Introduce you to PowerShell
Show how to install PowerShell
Introduce you to PowerShell modules
Show how to install and configure required PowerShell modules
Show how to run PowerShell scripts
This will be a high-level overview of PowerShell designed to give you enough familiarity with PowerShell to help you understand what it is and how to use it to automate backup of Qlik Sense server. I have put together all the scripts that you will need to run to backup your Qlik Sense servers and will explain how to use each one. So, everything you will need to do to setup your servers for automated backups will be explained in a typical howdash, step-by-step fashion with a bunch of screenshots and the focus to make this process as straightforward as possible for you.
Guide
Summary
All Set!
Now that we have a path forward laid out, let’s start building out the environment and process that will enable autonomous and automated backup process. Key takeaway here is that once you have PowerShell Modules in place, scripts written, passwords saved, backup directories created, and tasks setup, you will be able to sit back and watch Windows Server automatically and autonomously backup entire Qlik Sense server for you.
I hope you’re excited. I’m excited! Let’s get started by getting ourselves familiar and comfortable with PowerShell. In the next lesson, I will introduce you to PowerShell and give you some context around what it is and how it can be used to automate backup of a Qlik Sense server. I’ll see you in the next lesson!
References
Up Next
Introduction to PowerShell for Qlik Sense
Copyright © 2023 howdash LLC



