Migrate Community Sheets from Qlik Sense Windows to SaaS
1 Migrate community sheets from Qlik Sense Windows to SaaS
In this tutorial you are going to use qlik-cli to identify community sheets in Qlik Sense applications, export them from client-managed, and import them to an app published to a managed space in Qlik Sense SaaS.
Note At the time of publishing this tutorial, it is not possible to change the owner of any application object in a Qlik Sense app on the SaaS platform. The owner of migrated community sheets is the user whose API key performs the commands executed in this tutorial.
1.1 Set up this tutorial
To complete this tutorial, please complete these prerequisites.
- qlik-cli version 1.5.0 or higher
- A licensed Qlik Sense on Windows instance with JWT virtual proxy configured
- A licensed Qlik Sense SaaS tenant with a valid API key
- Basic knowledge of jq using bash or working with JSON in powershell.
- A Qlik Sense app migrated from client-managed to SaaS, published to a managed space.
1.2 Get community sheet objects from Qlik Sense on Windows
1.2.1 Set qlik-cli context to work with Qlik Sense on Windows
After you configure a context in qlik-cli to contact Windows, set the current
context by issuing qlik context use <QSEoW context name>
in the terminal
prompt.
1.2.2 Get a list of community sheets for an app
Sheets in Qlik Sense apps have two boolean properties controlling the level they
sit at in the visibility hierarchy: approved
and published
. Community sheets
are set to
{
"approved": false,
"published": true
}
indicating that they are not private, but they are also not base sheets of the app.
Obtaining a list of community sheets from a client-managed repository uses the
qlik qrs
command in the cli. The qrs API in client-managed has robust
filtering capabilities you can learn more about here.
Retrieve a list of community sheets in an app by specifying the app's unique Id in the filter along with the approved property set to fals and the objectType property equal to sheet.
#App Ids in Qlik Sense are GUIDs (e.g. bc594ff2-1652-4b4d-b49c-a100fa775856)
appId="<the app id>"
#Get a list of community sheets from the repository
community-sheets=$(qlik qrs app object ls --filter "app.id eq $appId and approved eq false and objectType eq 'sheet'" --insecure)
//returns an array
[
{
id: '1ec2eaf5-3570-4fd3-beeb-11a7cdbfc848',
engineObjectType: '',
description: '',
objectType: 'sheet',
publishTime: '2021-03-05T21:03:50.090Z',
published: true,
name: 'My new sheet',
engineObjectId: '99069c50-d556-4ed6-a3d9-8a1be9ebcce3',
contentHash: "G92%5RU393W8UK&Q/+1'3->C<BR-7U`6)A5<**DX\\B!",
privileges: null,
},
];
1.2.3 Unbuild the app
Unbuilding a Qlik Sense app takes the standard app format - known as a qvf - and
serializes it into a collection of JSON objects in JSON files. After unbuilding
the app, use the community sheet list obtained in the previous step to identify
the artifacts to import into SaaS. The qlik app unbuild
command accepts an app
argument and a directory argument for writing the JSON files to the location you
specify.
#App Ids in Qlik Sense are GUIDs (e.g. bc594ff2-1652-4b4d-b49c-a100fa775856)
appId="<the app id>"
appFolder="<folder to store serialized app>"
#unbuild the app
qlik app unbuild --app $appId --dir $appFolder
#Results in a JSON serialized version of the app in the directory you specify
foobar-unbuild
├── app-properties.json
├── config.yml
├── connections.yml
├── dimensions.json
├── measures.json
├── objects
│ ├── appprops---28490d95-7238-43b2-8ed4-393a8ab75a9d.json
│ ├── binky---binky.json
│ ├── masterobject-filterpane-color-by-gduuhw.json
│ ├── masterobject-map-sales-by-state-zswlzs.json
│ ├── masterobject-pivot-table-sales-by-rep-and-customer-gujwpf.json
│ ├── masterobject-scatterplot-sales-vs-margin-by-product-sub-group-ydsxt.json
│ ├── masterobject-table-sales-reps-sales-variance-ty-vs-ly--prgzes.json
│ ├── my-list-object---22bf32a3-d406-4ed4-b6a4-2ad361a79bf9.json
│ ├── sheet--budget-analysis-gnazpy.json
│ ├── sheet--kpi-dashboard-jzjmza.json
│ ├── sheet--my-new-sheet-99069c50-d556-4ed6-a3d9-8a1be9ebcce3.json
│ ├── sheet--sales-analysis-jdspj.json
│ ├── sheet--sales-margin-analysis-duxnf.json
│ ├── sheet--sales-rep-performance-lchbs.json
│ ├── story--customer-retention-product-analysis-pjepm.json
│ └── story--sales-rep-performance-wjzwy.json
├── script.qvs
└── variables.json
1.3 Import community sheet objects to SaaS
1.3.1 Set qlik-cli context to work with Qlik Sense on SaaS
Set the current context to SaaS by issuing
qlik context use <QSESaaS context name>
in the terminal prompt.
1.3.2 Add the community sheet to the application
Adding a sheet object to an app uses the qlik app object set
command where you
specify the path to the file containing the JSON representation of the sheet and
the app Id (aka GUID) to write it to. Adding the sheet makes it a private sheet
of the referenced application.
#set the appid
appId="<the app id>"
appFolder="<folder to store serialized app>"
sheetName="<exported JSON file name>"
#Add the sheet to the application
qlik app object set $appFolder/objects/$sheetName --app $appId
1.3.3 Publish the sheet to the community layer
Moving the sheet from a private status to community uses the publish
command
within qlik app object
#set the appid
appId="<the app id>"
sheetId="<the sheet's object id>"
#publish the sheet to the community section of the app
qlik app object publish $sheetId --app $appId