Skip to main content

Exporting your Qlik Sense Enterprise apps

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Clever_Anjos
Employee
Employee

Exporting your Qlik Sense Enterprise apps

Last Update:

Jul 16, 2018 10:54:17 AM

Updated By:

Clever_Anjos

Created date:

Jul 16, 2018 10:54:17 AM

For some reason you may want to dump all your applications from a QSE box and the QMC only allow you export only at once, right?

Using the work of aay‌ (https://github.com/ahaydon/Qlik-Cli) I´ve written a piece of code (Powershell) that dumps all your apps to a specific folder and segregating them according to your streams (each stream app goes to same folder)

Please make your adjustements and this is made available "AS IS" without warranty of any kind

$myserver = "yourserver.youdomain.com"

$folder = "c:\dump"

Connect-Qlik $myserver ## check https://github.com/ahaydon/Qlik-Cli for details


foreach($qvf in $(get-qlikapp)) {

    if ($qvf.published -and $qvf.stream.name) { # Is it published?

        $streamfolder = $qvf.stream.name

        If(!(test-path "$folder\$streamfolder")) # Create a folder if it does not exists

        {

              New-Item -ItemType Directory -Force -Path "$folder\$streamfolder"

        }

    } else {

        $streamfolder = ""

    }

    Export-QlikApp -id $qvf.id -filename "$($folder)\$($streamfolder)\$($qvf.name).qvf" #dumps the qvf

}


Comments
peter_turner
Partner - Specialist
Partner - Specialist
Great example of the QlikCLI tool. I'd like to export all apps but from a specific stream, how can you filter the Export-QlikApp to perform this?
0 Likes
michasiuk
Contributor III
Contributor III

I haven't quite figure out how to use the "-filter" option so I just use a pipe and a where clause not directly related but the principle is the same

Get-QlikApp -full -raw | where {$_.name -eq "MNISTR01 - Electorate Briefs"}

0 Likes
peter_turner
Partner - Specialist
Partner - Specialist

So... I've been researching this and using various examples and snippets have got the following working examples.

The key part is to get your Get-QlikApp filter returning the correct results first, before inserting it into other commands.

To filter on a specific apps name:

Get-QlikApp -filter "name eq 'YourAppsName'" 

where the eq is equals, lots of other options are available.

Filter apps that have been given a Custom Property such as 'Backup QVF':

Get-QlikApp -filter "customProperties.value eq 'Backup QVF'"

 You can then combine this into an export command such as:

Export-QlikApp -id $(Get-QlikApp -filter "name eq 'YourAppsName'").id -filename "C:\My Backup QVFs\YourAppsName.qvf"

 

Then also combine this with Cuv's example on the original post to create a loop and export multiple apps.
One point to note is that if you have multiple apps on your QS system with the same name, and they are included in your export loop, they will overwrite each other as the name is not a unique value.

It should be possible to include parameters such as the app's owner or ID or last reload date into the exported filename, but i have not had the time to research this yet.

0 Likes
michasiuk
Contributor III
Contributor III

Are there any other options other than "eq" I'm just wondering if you can use statements like"and"  "or"  or "match"

0 Likes
doplear01
Creator
Creator

Anyone use this with jenkins and git for devops purpose?

0 Likes
mayuringale25
Partner - Creator
Partner - Creator

Hi @Clever_Anjos 

I have been working on a similar thing, I want to export all qlik sense app from QMC without data

 

$myserver = "win-2lumoofqs6m"


$folder = "C:\tmp"


Connect-Qlik $myserver ## check https://github.com/ahaydon/Qlik-Cli for details

 

foreach($qvf in $(get-qlikapp)) {


if ($qvf.published -and $qvf.stream.name) { # Is it published?


$streamfolder = $qvf.stream.name


If(!(test-path "$folder\$streamfolder")) # Create a folder if it does not exists


{


New-Item -ItemType Directory -Force -Path "$folder\$streamfolder"


}


} else {


$streamfolder = ""


}


Export-QlikApp -id $qvf.id -filename "$($folder)\$($streamfolder)\$($qvf.name).qvf" -SkipData:$true #dumps the qvf


}

 

Error: Export-QlikApp: A parameter cannot be found that matches parameter name
'SkipData'.

Can you help me with this issue

 

 

0 Likes
Clever_Anjos
Employee
Employee

I think you're using one outdated version, please update it

0 Likes
mayuringale25
Partner - Creator
Partner - Creator

Hi @Clever_Anjos  

Using same version which is uploaded at this link

https://github.com/ahaydon/Qlik-Cli

 

If you have updated version can you please share

0 Likes
ekademeteme
Contributor
Contributor

Greetings. Thank you for this solution, just one question. Where do you run this script?, Is it on any machine in the same domain with the QlikSense enterprise server or it has to be on the box with Qliksense enterprise?, meaning i will have to remotely log in to the server and run this script. Thanx for your response.

0 Likes
Version history
Last update:
‎2018-07-16 10:54 AM
Updated by: