Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW

Restore Apps after Deletion from QMC

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Chris_Rice
Support
Support

Restore Apps after Deletion from QMC

Last Update:

May 10, 2021 6:40:34 AM

Updated By:

Sonja_Bauernfeind

Created date:

Sep 27, 2019 10:35:43 AM

When apps are deleted from the QMC, the app and associated Static Content (like images) are both deleted from disk.

Delete Apps.png

 

Environment:

Qlik Sense Enterprise on Windows 

This means that simply restoring the app from a backup system will not restore all app properties, like images or user sheets. General directions for restoring an app from backup without images or user sheets can be found here:

Restore deleted app in Qlik Sense, Import app in Qlik Sense

Restoring an app with user sheets can only be done if a version of the original app remains on the host QMC, or a Repository Backup has been taken. That can be a duplicate of the app or the original app with missing QVF. This is because user sheets are stored in the Repository and associated with the app. There is currently no way to re-associate Repository sheets with different apps.

 

Resolution:

 

There are a few different ways to remedy this, assuming a backup of some type has been taken.

If there is a proper Repository Backup, reverting to the backup is the easiest way to fix this. Repository Backup/Restore procedures can be found here: Backup and restore Qlik Sense Enterprise on Windows

If a backup of the app binary has been made, then the binary can be re-imported. Any images associated with that app will need to be re-applied manually as binaries do not include these images.

Import Button.png

If an export of the app has been saved, the app export can be re-imported. This will have the images in-tact as exports are saved with images.

If a full disk backup has been made, this can be restored on the current system with no loss.

If the full disk backup is old, and you do no wish to miss the data changed since the backup, you can restore the disk on a different system. Then, export the apps from the restored system and import them in the active system.

If there are many apps, this can also be done via API commands in Powershell.
Export all apps:

$hdrs = @{}
$hdrs.Add("X-Qlik-Xrfkey","examplexrfkey123")
$hdrs.Add("X-Qlik-User", "UserDirectory=INTERNAL; UserId=sa_repository")
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$apps = Invoke-RestMethod -Uri "https://qlikserver1.domain.local:4242/qrs/app/full?Xrfkey=examplexrfkey123" -Method Get -Headers $hdrs -ContentType 'application/json' -Certificate $cert
$appIDs = $apps.id
echo $appIDs

foreach ($id in $appIDs) {
    $body = '{}'
    $Data = Get-Content C:\ProgramData\Qlik\Sense\Host.cfg
    $FQDN = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($($Data)))
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
    $download = Invoke-RestMethod -Uri "https://$($FQDN):4242/qrs/App/$id/export/$($id)?xrfkey=examplexrfkey123" -Method Post -Body $body -Headers $hdrs -ContentType 'application/json' -Certificate $cert
    Invoke-RestMethod -Uri "https://$($FQDN):4242$($download.downloadPath)" -Method Get -Headers $hdrs -ContentType 'application/json' -Certificate $cert |  Set-Content $id.qvf -Encoding Ascii
}

Note: This will result in several errors like the following: "Set-Content : Cannot bind argument to parameter 'Path' because it is null." These can be ignored.

Import all apps on new system:
**In Progress**

Labels (1)
Contributors
Version history
Last update:
‎2021-05-10 06:40 AM
Updated by: