Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. READ MORE

Qlik Fix: How to use Qlik-CLI to Migrate Apps to Qlik Sense SaaS

100% helpful (3/3)
cancel
Showing results for 
Search instead for 
Did you mean: 
Andre_Sostizzo
Digital Support
Digital Support

Qlik Fix: How to use Qlik-CLI to Migrate Apps to Qlik Sense SaaS

Last Update:

Apr 13, 2021 2:35:35 PM

Updated By:

Andre_Sostizzo

Created date:

Apr 13, 2021 2:35:35 PM

Attachments

Hammer Up 1000x340.png

 This video is part of the Qlik Fix Video series. If you found this video useful, check out the other Qlik Fix Videos.

This video will demonstrate how to use Qlik-CLI for SaaS to migrate Apps from your on-premises Qlik Sense environment to your Qlik Sense SaaS edition. Qlik-CLI makes it possible for scripting and automating App migration.

Here is a link to the Support Knowledge Base article which contains links to mentioned documentation.

How to use Qlik-CLI to Migrate Apps to Qlik Sense SaaS 

Video Transcript:

Hi and welcome to Qlik Fix!
This video will demonstrate how to use Qlik-CLI for SaaS to migrate Apps from your on-premises Qlik Sense environment to your Qlik Sense SaaS edition.
Qlik-CLI makes it possible for scripting and automating App migration.
The tool may be installed and connected to you Qlik Sense SaaS tenant following the steps mentioned in this Community knowledge base article. (https://community.qlik.com/t5/Knowledge-Base/How-to-install-and-start-using-Qlik-CLI-for-SaaS-editio...)
Qlik-CLI can also be used to connecting to Qlik Sense on Windows via the QRS API.
As with SaaS Editions of Qlik Sense, the connection to Qlik Sense on Windows also requires a API Key for authentication. (qlik context get andresostizzo.us.qlikcloud.com)
The API key is essentially a JSON Web Token, or JWT, usually pronounced as jot.
So the first step is to have a new Virtual Proxy configured to accept JWT Authentication.
This will allow for qlik-cli to establish a trusted connection with the Qlik Sense server.
For detailed steps with enabling and testing JWT Authentication, take a look at this knowledge base article in community on how to set it up.
(https://community.qlik.com/t5/Knowledge-Base/Qlik-Sense-How-to-set-up-JWT-authentication/ta-p/171622...)
In this video's example however, we use the openssl commands found in this qlik.dev page to create a certificate and private key that are used for signing the JWT. (https://qlik.dev/tutorials/using-qlik-sense-on-windows-repository-api-qrs-with-qlik-cli#create-a-pub...)
Then, we create the JWT with the code sample found in this section, using Node. (https://qlik.dev/tutorials/using-qlik-sense-on-windows-repository-api-qrs-with-qlik-cli/#tokenjs-cod...)
NodeJS can be downloaded from the Nodejs.org website. (https://nodejs.org/en/download/)
After installing it, the jsonwebtoken module needs to be installed with the following node package management (NPM) command. (npm install jsonwebtoken)
Now we can edit the provided Token.js javascript code for creating the token.
Note that the userid and userdirectory attributes names as well as the value specified for the audience (aud) attribute are all case sensitive, and need to match what is configured in the Virtual Proxy.
Also make sure to indicate an existing licensed user for the userid and userdirectory.
For jwtEncryptionKey, fill in the location for the private key file generated previously with openssl.
Now we can run this code with the following node command. (node token.js)
The token should be created and displayed.
Next, we need to create the context for the connection with the Qlik Sense server.
Run the following command with values for the context name, URL for the Virtual Proxy, server type as Windows, and the api-key which is the new JWT created. (qlik context create QSEoW --server https://192.168.254.243/jwt --server-type windows --api-key)
Note that if an IP or alias is used in the URL, it needs to be added to the Virtual Proxy's list of allowed hosts.
Now we switch to the newly created context with the context use command, and we are ready to run qlik qrs commands.
For example, the following command will retrieve a list of Apps and their IDs in JSON format. (qlik qrs app ls --insecure | jq -r '.[] | {"name":.name,"id":.id}')
Notice that the --insecure flag allows for the command to be run from outside the Qlik Sense server itself.
Also note that we are piping the output to a JSON processing tool called JQ.
JQ can be downloaded from the following web page. (https://stedolan.github.io/jq/)
Another example would be the need to retrieve App IDs for a specific Stream.
Adding the stream name object in the JQ command, and then piping it to the select-string command can help listing the App names and ids that were published to the specified stream.
(qlik qrs app ls --insecure | jq -r '.[] | {"name":.name,"id":.id,"stream":.stream.name}' | select-string "Monitoring apps" -context 2,0)
Next we can export one of these apps. Let's first set the variables for the App ID, the exported filepath, and new filename.
Now we can use these variables in the following command for exporting the App.
Note that the --skipdata flag exports the App without data.
This is beneficial with larger Apps since there is an upload size limit of 1GB when importing Apps to Qlik Sense SaaS editions.
More information on app sizing is available in the following article. (https://community.qlik.com/t5/Knowledge-Base/Qlik-Sense-Business-and-Enterprise-SaaS-App-Size-Storag...)
We will also add the flag -v to enable verbose mode and display more result information.
We can see that a 200 OK is returned, and that the app is successfully exported.
The next step is to import the App into the Qlik Sense SaaS instance.
First we need to switch to the context used for your Qlik Sense SaaS tenant.
Review the values stored in our variables.
Then use the following command to import the App, and store its ID to the "SaaSApiID" powershell variable.
The App should now show in Cloud Hub under Explore.
Keep in mind that exported apps do not contain original private sheets and have the public sheets and stories set as private as seen here.
You may publish the sheets manually via Cloud Hub, or use qlik-cli as in the following example.
First review the imported App ID variable created previously.
With the following command obtain a list of sheets in the app.
Then, set all of them to public.
We can see the result in cloud hub and then notice the App is still found under the user's personal space.
The app may be assigned to a specific space, and many other tasks are available as well via Qlik-CLI.
Examples for Space assignment and owner changes can be found in the qlik.dev page shown here. (https://qlik.dev/tutorials/migrate-apps-from-qlik-sense-on-windows-to-qlik-sense-saas#place-the-app-...)
If you’d like more information,
Take advantage of the expertise of peers, product experts, and technical support engineers
by asking a question in a Qlik Product Forum on Qlik Community.
Or search for answers using the new SearchUnify tool.
It searches across our Knowledge Base, Qlik Help, Qlik Community, Qlik YouTube channels and more, all from one place.
Also check out the Support Programs space.
Here you can learn directly from Qlik experts via a Support webinar, like Techspert Thursdays.
And don’t forget to subscribe to the Support Updates Blog.
Thanks for watching.
Nailed it!

 

Attached is a downloadable .mp4 video file for those who cannot view YouTube videos.

#QlikSupport

Labels (1)
Comments
Diego95
Partner - Contributor
Partner - Contributor

Visto

marksouzacosta
Partner - Specialist
Partner - Specialist

Hello community,

In addition to Qlik CLI, I'd like to introduce you to a powerful tool developed by IPC Global — the inProcess App Operations CLI. This tool is designed to seamlessly transfer Qlik Applications between Qlik client-managed and Qlik Cloud environments. Moreover, it simplifies the process of setting up backup routines for your Qlik Sense Applications, ensuring the security of your critical data.

For those interested in exploring this innovative solution further, we invite you to visit our website: https://www.ipc-global.com/inprocess-app-operations.

You can also take advantage of our free trial to experience firsthand how inProcess App Operations can enhance and streamline your Qlik application management.

Feel free to reach out if you have any questions or if there's anything else we can assist you with.

Best regards,
Mark Costa
Product Manager
IPC Global

0 Likes
itsmeanay
Partner - Contributor II
Partner - Contributor II

@Andre_Sostizzo I have understood the entire flow and above we had created a context for Qliksense enterprise I assume. Can you also explain how do I create a context for Qlik Sense SaaS tenant in same manner to use it like you did.

0 Likes
Sonja_Bauernfeind
Digital Support
Digital Support

Hello @itsmeanay 

These should help:

If you need more direct assistance, please post your query in the appropriate forum (Integration and API), where your knowledgeable Qlik peers and our support agents can assist you.

All the best,
Sonja 

0 Likes
Contributors
Version history
Last update:
‎2021-04-13 02:35 PM
Updated by: