Qlik Community

Qlik Sense Documents

Documents about Qlik Sense.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER

Exporting your Qlik Sense Enterprise apps

Employee
Employee

Exporting your Qlik Sense Enterprise apps

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
Partner
Partner
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
Contributor
Contributor

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
Partner
Partner

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
Contributor
Contributor

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

0 Likes
Contributor II
Contributor II
0 Likes
Contributor III
Contributor III

Anyone use this with jenkins and git for devops purpose?

0 Likes
Partner
Partner

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
Employee
Employee

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

0 Likes
Partner
Partner

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
Version history
Revision #:
1 of 1
Last update:
‎2018-07-16 10:54 AM
Updated by: