Exporting and Importing Security rules – Qlik Sense to Git
This article is intended as a guide for those who are faced with the situation of figuring out who caused a disaster by editing the Security Rules in Qlik Sense and how to roll back to the last stable version.
As a Qlik administrator you’ve probably experienced a situation where someone with access to QMC has changed several Security Rules and this affects every user’s (with a Professional License) ability to see and edit Data Load Script in a published app.
This could have happened for many reasons, but in this article, we won’t be focusing on the cause. Let’s figure out how to live with it after the fact and how to quickly restore a backup of your Security Rules.
Wait…backup?!
There are two groups of people: those who do backups, and those who will start doing backups.
Ways To Back-Up Security Rules In Qlik Sense
There are different ways to make a backup of security rules:
- Export it using Qlik-Cli.
- Figure out how to install outdated qmcu-rule-manager on new Qlik Sense releases.
- Version security rules in the Git repository or in a JSON file using Gitoqlok.
The first step involves having access to a Qlik server and some scripting skills or a copy-pasting skillset 🙂
The third step is the easiest way to make a quick backup and restore it when it is really needed through a visual interface without installing any third-party software on your server.
How to backup security rules using Gitoqlok
First, install Gitoqlok into your browser from Chrome Web Store. Find Gitoqlok in the Chrome Web Store and press the Install button.
Gitoqlok is the freemium, easy-to-use version control tool that works from your browser. It integrates your Qlik Sense app with git repository through GitHub, Gitlab, Gitea, AWS Commit, BitBucket APIs without any third-party servers between.
After doing that, configure your Gitoqlok profile on the options page of the Gitoqlok Chrome extension. It asks to allow Gitoqlok to communicate with your Git repository (it is required only if you want to save your Security Rules into a specific Git repository).
If you are not familiar with GitHub or Gitlab there are some helpful links in the end of article.
When you have successfully configured Gitoqlok follow the instructions from the video below:
- Go to the Qlik Sense Hub and click on the “Env Migration” button in the Gitoqlok extension.
- Select security rules which you want to export to your Git repository or want to save into a JSON file.
- Press the Export button.
Now, you have a backup of your Security Rules and can easily restore them with Gitoqlok.
How to restore a Security Rules backup using Gitoqlok
Just go into the Import section on the “Environment Migrator” page and select a JSON file or a Git repository that contains Security Rules.
Gitoqlok will show you the difference between the saved version of Security Rules and the current state, so that you can easily decide what to do in the event of a conflict.
Conclusion
So, that’s how you can make a backup of Security Rules and restore the backup using Gitoqlok.
I hope it was useful and interesting for you.
Let me, know if you have any questions about Gitoqlok — my Linkedin.
P.S. Don’t forget to subscribe to me on Youtube, because we have a series of Tip&Tricks videos around Qlik Sense and Git integration.
Useful links:
- Deep dive into Gitoqlok Security Rules Manager — https://play.goconsensus.com/586a9867
- Git for newbies https://docs.gitoqlik.com/main/git-for-newbies
- Guide. Connect Gitoqlok to Git provider- https://docs.gitoqlik.com/main/connect-to-github
- Exporting and importing Security rules using Qlik-Cli — https://community.qlik.com/t5/Knowledge/Exporting-and-importing-Security-rules-using-Qlik-Cli/ta-p/1717288