Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Jul 16, 2018 10:54:17 AM
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
}
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"}
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.
Are there any other options other than "eq" I'm just wondering if you can use statements like"and" "or" or "match"
Filter syntax and options: https://help.qlik.com/en-US/sense-developer/February2019/Subsystems/RepositoryServiceAPI/Content/Sen...
Anyone use this with jenkins and git for devops purpose?
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
I think you're using one outdated version, please update it
Using same version which is uploaded at this link
https://github.com/ahaydon/Qlik-Cli
If you have updated version can you please share
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.