Friday, 23 May 2025

STEP by STEP : Qlik Sense Server Migration by Cloning with Hostname Change

STEP by STEP : Qlik Sense Server Migration by Cloning  with Hostname Change

Step 1: Prepare and Backup the Source Server

1.1 Stop All Qlik Services

Open Services.msc and stop these in order:

  • Qlik Sense Engine Service

  • Qlik Sense Proxy Service

  • Qlik Sense Repository Service

  • Qlik Sense Scheduler Service

  • Qlik Sense Service Dispatcher

1.2 Backup the Following Folders

Manually copy these folders to a safe location:

makefile

C:\ProgramData\Qlik\Sense\Repository\ C:\ProgramData\Qlik\Sense\Apps\ C:\ProgramData\Qlik\Sense\Certificates\ C:\Program Files\Qlik\

1.3 Backup PostgreSQL Databases

Use pg_dump or Qlik Shared Persistence tools:

bash
pg_dump -U postgres -F c -b -v -f "QSR.backup" QSR pg_dump -U postgres -F c -b -v -f "SenseServices.backup" SenseServices

Step 2: Clone the Server and Change Hostname

2.1 Clone the Source Server

Use your hypervisor or disk cloning tool to replicate the VM (e.g., VMware, Hyper-V, Veeam).

2.2 Power On and Rename New Server

  1. Boot the new server on isolated or test network.

  2. Change hostname:

    • System Properties > Computer Name > Change

    • Reboot after change

2.3 Ensure Old Server is Offline (to avoid hostname conflicts)


Step 3: Update Qlik Sense Configuration on New Server

  • Log in as the service account.
  • Stop all the Qlik Sense services, except for the Qlik Sense Repository Database.
  • Use Microsoft Management Console(MMC) to backup and then delete all the Qlik Sense related certificates (client, server, trusted root). (From Personal and Local User)
  • Delete or rename the folder %ProgramData%\Qlik\Sense\Repository\Exported Certificates\.Local Certificates.
  • Make a copy of %ProgramData%\Qlik\Sense\Host.cfg and rename the copy to Host.cfg.old. Host.cfg contains the hostname encoded in base64. You can generate this string for the new hostname using a site such as base64encode or by running the following PowerShell scriptlet:[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("yourServerHostname.yourDomain.com"))
  • Open Host.cfg and replace the content with the new string.



Step 4: Bootstrap the Repository to Register New Hostname

4.1 Run Bootstrap Command

In Administrator PowerShell:

powershell

"C:\Program Files\Qlik\Sense\Repository\Repository.exe" -bootstrap -restorehostname
-standalone

 This:

  • Rebinds the repository to the new hostname

  • Re-registers the node in the Qlik Repository Database (QSR)

  • Uses the value in host.cfg

Wait for successful completion. Check logs:

C:\ProgramData\Qlik\Sense\Log\Repository\Trace\ Start all the Qlik Sense services in the proper order. If the script doesn't get to "Bootstrap mode has terminated. Press ENTER to exit.." and
gets stuck at " Entering main startup phase.." start the "Qlik Sense dispatcher service"
and it will get to the end)


Repository Database consideration: The relevant tables in the repository database that contain the host name information are: LocalConfigs ( Hostname column ) ServerNodeConfigurations ( Host Name ) Note: Please make sure that the above table hostname column should contain the correct server FQDN
( network host name and not the individual machine host name ) this should be exactly the hostname
that is in the host.config file Note : LocalConfigs table has been removed in Qlik Sense Enterprise February 2019 and newer.

Step 5: Apply Qlik Sense License

5.1 Access QMC on New Hostname

  • Open: https://NewServerName/qmc

  • Navigate to: License Management

  • Apply your license:

    • LEF (old model) or

    • Signed License Key (SLK)

Note: If the license is already in use by the old server, you may need to deactivate it via Qlik support or license portal.


Step 6: Validate All Services

  1. Ensure all services are running:

    • Use QMC > Service Cluster or services.msc

  2. Validate:

    • QRS (Repository)

    • QES (Engine)

    • QPS (Proxy)

    • QSS (Scheduler)

  3. Check system logs under:

    C:\ProgramData\Qlik\Sense\Log\

Step 7: Update Environment Configurations

7.1 Update Data Connections

  • QMC > Data Connections

  • Edit any UNC paths or host-based links

 7.2 Update UDC (User Directory Connector)

  • QMC > User Directory Connectors

  • Update any host references

7.3 Review and Fix Hardcoded Hostnames

  • App Load Scripts

  • QlikView-style scripts using lib:// or full paths

Use the QlikSenseUtil at C:\Program Files\Qlik\Sense\Repository\Util\QlikSenseUtil\QlikSenseUtil.exe to inject in the new share path. 
Note: Use alternative installation path if Qlik Sense is not installed to C:\Program Files
  • First, connect to the database under the Connect to database tab.  
  • For Host Name type the new Central node FQDN. 
  • Use the default postgres Database user and the password created during the Qlik Sense installation.
  • In the Service cluster tab, click OK to retrieve the current Share paths. 
  • Change them to include the new hostname and click Save.
  • Click Clear and then OK once more to confirm the new paths have been saved to the database.

Step 8: Validate Platform

Basic Checks

  • Hub access: https://NewServerName/hub

  • QMC access

  • Reload test apps

  • Access sheets and streams

  • Check for certificate warnings in browser

Monday, 19 May 2025

STEP by STEP : Qlik Sense Architecture

 

Qlik Sense Architecture Diagram


+---------------------------------------------------+ | User Layer | | | | +-----------+ +-----------------------+ | | | Qlik Sense |<-->| Web Browser / Qlik Hub| | | | Hub (UI) | | (Client-Side Interaction)| | +-----------+ +-----------------------+ | | | +---------------------------------------------------+ | | | REST APIs | (For Authentication, Session, Data, etc.) | | v v +---------------------------------------------------+ | Proxy Server (QPS) | | - Handles user authentication and sessions | | - Manages load balancing between Qlik nodes | +---------------------------------------------------+ | v +---------------------------------------------------+ | Repository Service (QRS) | | - Stores app metadata, configurations, and | | security rules. | | - Responsible for app management. | +---------------------------------------------------+ | v +---------------------------------------------------+ | Engine (QES - Qlik Engine) | | - In-memory calculations (Associative Model) | | - Processes selections and updates on-the-fly | | - Loads data (QVDs) and manages data models | +---------------------------------------------------+ | v +---------------------------------------------------+ | Data Layer (QVDs) | | - Optimized Qlik Data files for fast reloads | | - Stores processed, transformed data | +---------------------------------------------------+ | v +---------------------------------------------------+ | External Data Sources | | - Databases, APIs, Excel, Web Connectors | | - Extracted, transformed, and loaded into Qlik | | via the Data Load Script | +---------------------------------------------------+

Explanation of the Components:

  1. User Layer (Qlik Hub)

    • This is where the user interacts with Qlik Sense. Users access apps, interact with visualizations, and make selections.

    • Everything in the Hub happens client-side (browser).

  2. Proxy Server (QPS)

    • The proxy is responsible for authentication and session handling. It manages communication between the User Layer (Qlik Sense Hub) and the Engine.

    • It also load-balances user requests if multiple Qlik nodes are available.

  3. Repository Service (QRS)

    • The Qlik Repository Service stores metadata about apps, security rules, and other configuration data.

    • It also handles tasks like user permissions and app management.

  4. Qlik Engine (QES)

    • The Qlik Engine is the brain of the Qlik Sense platform. It handles:

      • In-memory calculations (e.g., aggregations, filtering).

      • Data modeling based on the Associative Model.

      • Selection evaluations (green-white-grey logic).

    • It is the core engine that performs operations when users make selections or interact with the app.

  5. Data Layer (QVDs)

    • QVD (Qlik View Data) files are optimized data files used for fast data reloads. These files store data that has been pre-processed by the ETL (Extract, Transform, Load) scripts.

    • Qlik Sense uses QVDs to quickly load and use data in-memory.

  6. External Data Sources

    • Qlik pulls data from various external sources (e.g., databases, flat files, APIs).

    • The data is loaded, transformed, and stored in QVDs via Data Load Scripts.


How Data Flows:

  1. User Request: A user makes a request via the Qlik Sense Hub (e.g., opening an app, making a selection).

  2. Authentication: The request passes through the Proxy Server, which authenticates the user.

  3. App Data: The Qlik Engine retrieves data from the QVDs or directly from external data sources if required.

  4. In-Memory Calculation: The Qlik Engine performs any necessary calculations (using the Associative Model).

  5. Data Update: The results are sent back to the Hub and presented to the user in real-time.

STEP by STEP : Qlik Sense Security Rules – Basics

 

Qlik Sense Security Rules – Basics


🧠 What Are Security Rules?

Security rules in Qlik Sense define who can do what with which resource, based on:

  • User attributes (e.g., user name, group)

  • Resource types (app, stream, object)

  • Actions (read, update, publish)

They are written using conditions and expression logic.


🏗️ Anatomy of a Security Rule

A rule has the following components:

ComponentDescription
Resource filterDefines the type of resource (e.g., App_*, Stream_*, Sheet_*)
ActionsWhat users can do: read, update, publish, exportdata, etc.
ConditionsLogic to determine access (user.name, user.group, etc.)
ContextDetermines if it applies in Hub, QMC, or both

Examples of Basic Security Rules


🔹 1. Allow a user access to a specific stream

Goal: Grant user john.doe access to a stream called "Sales".

Rule:

  • Resource filter: Stream_*

  • Conditions: resource.name = "Sales" and user.name = "john.doe"

  • Actions: read


🔹 2. Allow a group access to all apps in a stream

Goal: Members of the Finance group can access all apps in the "Finance" stream.

Rule:

  • Resource filter: App_*

  • Conditions: resource.stream.name = "Finance" and user.group = "Finance"

  • Actions: read


🔹 3. Allow only the app owner to edit the app

Rule:

  • Resource filter: App_*

  • Conditions: resource.owner.userId = user.userId

  • Actions: update


🔹 4. Allow users to publish to a stream

Goal: Let developers publish apps to the “Development” stream.

Rule:

  • Resource filter: Stream_*

  • Conditions: resource.name = "Development" and user.group = "Developers"

  • Actions: publish


🔹 5. Prevent access to all unpublished apps

Rule:

  • Resource filter: App_*

  • Conditions: !resource.published

  • Actions: read

  • Check box: Deny access

💡 Use this as a deny rule, placed above general read access rules.


🛠️ How to Create a Rule in QMC

  1. Go to Qlik Management Console (QMC)

  2. Click Security Rules

  3. Click Create New

  4. Fill in:

    • Name

    • Resource filter (e.g., App_*, Sheet_*)

    • Actions (e.g., read, update)

    • Conditions using user. and resource. attributes

  5. Set Context (Hub, QMC, or both)

  6. Click Apply

STEP by STEP: Create a Simple Qlik Sense Extension

 

Step-by-Step Guide: Create a Simple Qlik Sense Extension


Prerequisites

  • Qlik Sense Enterprise or Qlik Sense Desktop

  • Access to Qlik Dev Hub (/dev-hub)

  • Basic knowledge of HTML, JavaScript, CSS

  • Optional: Access to a Qlik Sense server for deployment


🔹 Step 1: Open Dev Hub

  1. Open a browser and go to:

    bash

    http://localhost:4848/dev-hub (Qlik Sense Desktop) https://<your-server>/dev-hub (Enterprise)
  2. Click Extension Editor”


🔹 Step 2: Create a New Extension

  1. Click Create New

  2. Provide a:

    • Name: e.g., SimpleBarChart

    • Description (optional)

    • Select or create a library folder

  3. Click Create

Qlik generates a boilerplate extension with:

  • Definition.js (main config)

  • Script.js (controller/logic)

  • Template.html

  • Style.css


🔹 Step 3: Define the Extension (JavaScript)

In the Definition.js, define how your extension behaves:

javascript

define([ 'jquery', 'qlik', 'text!./template.html', 'css!./style.css' ], function ($, qlik, template) { return { definition: { type: "items", component: "accordion", items: { settings: { uses: "settings", items: { title: { ref: "props.title", label: "Title", type: "string", defaultValue: "My Extension Title" } } } } }, paint: function ($element, layout) { let html = template.replace("{{title}}", layout.props.title); $element.html(html); return qlik.Promise.resolve(); } }; });

🔹 Step 4: Create HTML Template

In template.html, add:

html

<div class="simple-extension"> <h2>{{title}}</h2> <div>Welcome to your first Qlik Sense extension!</div> </div>

🔹 Step 5: Add CSS Styling (Optional)

In style.css:

css

.simple-extension { background: #eef5fb; padding: 10px; border-radius: 5px; font-family: Arial, sans-serif; } .simple-extension h2 { color: #007acc; }

🔹 Step 6: Save and Use the Extension

  1. Click Save in Dev Hub

  2. Open a Qlik Sense app

  3. Go to a sheet → Custom Objects → Extensions

  4. Drag your extension onto the sheet

  5. Configure the title in the right-hand panel


🔄 Optional: Add Dimension & Measure Support

In definition block:

javascript

definition: { type: "items", component: "accordion", items: { dimensions: { uses: "dimensions", min: 1, max: 1 }, measures: { uses: "measures", min: 1, max: 1 }, settings: { uses: "settings" } } }

Access them in paint like:

javascript

var dimension = layout.qHyperCube.qDataPages[0].qMatrix[0][0].qText; var measure = layout.qHyperCube.qDataPages[0].qMatrix[0][1].qNum;

📦 Step 7: Export for Deployment (Enterprise)

  1. Locate the folder in:

    php-template

    C:\Users\<user>\Documents\Qlik\Sense\Extensions\<YourExtensionName>
  2. Zip the folder

  3. Upload it to QMC → ExtensionsImport

STEP by STEP: Create a Simple Widget in Qlik Sense

 

 Step-by-Step: Create Simple Widget in Qlik Sense


Prerequisites

  • Qlik Sense Enterprise (or Qlik Sense Desktop)

  • Access to the Qlik Sense Dev Hub

  • Basic knowledge of HTML, CSS, and JavaScript


🔹 Step 1: Open the Developer Hub

  1. Open a browser and go to:

    https://<your-qlik-sense-server>/dev-hub

    (Or use http://localhost:4848/dev-hub if using Qlik Sense Desktop)

  2. Click on "Widget Editor"


🔹 Step 2: Create a New Widget

  1. Click "Create New" on the top-right

  2. Enter:

    • Name: e.g., SimpleTextWidget

    • Description: Optional

    • Library: Choose an existing library or create a new one

  3. Click Create


🔹 Step 3: Define the Widget Template (HTML)

In the Template section, enter your basic HTML. For example:

Html
<div class="my-widget"> <h2>{{title}}</h2> <p>{{description}}</p> </div>

🔹 Step 4: Define Widget Properties (Fields)

Switch to the "Controller" tab and define properties users can configure in Qlik Sense. 

For example:

javascript

return { definition: { type: "items", component: "accordion", items: { settings: { uses: "settings", items: { title: { ref: "title", label: "Title", type: "string", defaultValue: "My Widget Title" }, description: { ref: "description", label: "Description", type: "string", defaultValue: "This is a simple Qlik Sense widget." } } } } }, paint: function ($element, layout) { // Optional: dynamic JS code return qlik.Promise.resolve(); } };

This allows the user to enter a title and description via the properties panel.


🔹 Step 5: Add Basic Styling (Optional)

Go to the "Style" section and add some CSS:

css

.my-widget { padding: 10px; background-color: #f5f5f5; border-radius: 5px; font-family: sans-serif; } .my-widget h2 { color: #007acc; }

🔹 Step 6: Save and Use in App

  1. Click Save.

  2. Go back to your Qlik Sense app.

  3. Open a sheet and add a new object.

  4. Find your widget under "Custom Objects" > "Widgets".

  5. Drag it onto the canvas and configure the properties.


STEP by STEP : Qlik Sense Server Migration by Cloning with Hostname Change

STEP by STEP : Qlik Sense Server Migration by Cloning  with Hostname Change Step 1: Prepare and Backup the Source Server 1.1 Stop All Qlik ...