Git Product home page Git Product logo

qs-backup-and-restore-app's Introduction

Qlik Sense Mashup for Backup and Restore apps

Using the SerializeApp from Alexander Karlsson we can export the QS app ( without the data ) to json file. This will include all objects - sheets, dimension and measures, stories etc. Then this file can be put under version control or can be stored just as a backup.

The next step is to use the json file to import it back when is needed. And this is what (part of) this mashup is supposed to do. This mashup provide both export the app to json and import the json file.

Supported objects

  • sheets ( with all containing objects )
  • stories
  • master objects
  • dimensions
  • measures
  • snapshots
  • bookmarks
  • variables
  • app properties - like name, thumbnail, description etc.
  • load script
  • fields

Installation

Works with QS version >=2.1.1

  • QS Desktop - unzip the release in C:\Users\[USERNAME]\Documents\Qlik\Sense\Extensions
  • QS Server
    • login to QMC
    • naviagete to "Extensions"
    • press "Improt" button (bottom of the page)
    • pick the release zip file
    • press "Import" button
    • (verify that the import process finished without errors from the notification popup)

Backup

During the export the app is not changed in any way. The generated file will be automatically downloaded to your download folder.

Restore

The restore process will read the existing app objects and will compare them with the objects from the backup file.

  • existing objects - the objects which are present in the current app and in the json file will be updated with the properties from the json file
  • missing objects - objects that are present in the current app and not present in the json file will be deleted from the app (see exclusions below)
  • new objects - objects which are present in the json file and not present in the current app will be created in the app
  • data connectors - existing data connectors will be updated but if data connector need to be inserted QS Engine will assign new id even if id is provided from the json file (this is how the engine works)

Few exclusions: Some objects are excluded from the overall process ( for now )

  • embedded media - the actual media files will not be deleted ( if needed ) and they will stay in the content library. At the current moment I haven't found a method that can include these files in the backup process.

After the restore process is finished the app will be saved to preserve the changes. It's highly recommended to reload the app after the restore process ( my plan is to add this as an option in the following releases )

Usage

  • Navigate to the mashup web page (for example: http://localhost:4848/extensions/backup-and-restore/backup-and-restore.html). The mashup will automatically establish connection with the QS Engine
  • Pick an app from the dropdown and press "Open" ( can take some time. depends on the app size )
  • At this point "Backup" button is active ( if you need to only backup an app or just backup before restore )
  • Choose the json backup file
  • After this you will see the statistics - how many objects will be deleted, inserted and updated. Deleted objects will always be more. This number include all the sheets objects (including the sheets itself) but the json file count only the sheets ( the objects in the sheets are sheets children and they are included in the sheet object itself )
  • press the "Restore" button and wait for the process to finish. After the process is done the result table will be populated with more detail about the objects that were processed.
  • That's it! If you have the app already open just refresh the browser tabs where this app is open.

Note

If the file is unable to download in IE please make sure that your "File download" option is set to "Enabled" in IE Security Settings for Internet

Change log

v0.9.6 (26/07/2016)

  • add - data connectors will be updated, deleted and inserted
  • add - error count indicator + mark the error rows

v0.9.5 (11/03/2016)

  • fix - downloading the serialized app file works in Firefox

v0.9.3 (18/01/2016)

  • fix - downloading the serialized app file works in IE 11+

v0.9.2 (17/01/2016)

  • fix - opening multiple apps is performed correctly

v0.9.0 (03/01/2016)

  • add - "variables" support
  • update - qsocks to v2.1.5
  • update - serializeapp to v1.0.3
  • fix - no need to refresh the page to switch the apps

Please report and issues in the Github issue tracker

Screenshot

qs-backup-and-restore-app's People

Contributors

countnazgul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qs-backup-and-restore-app's Issues

What are we missing ?

Hi Stefan,
we'd like to use your extension, but wonder if it's still active and/or if we're missing something.
Basically the steps we're following are:

  1. from http://localhost:4848/extensions/backup-and-restore/backup-and-restore.html we
    open an application
  2. the we specify an empy .json file as the backup file
  3. we press the Backup button

At this point everything seems to freeze forever. Are we missing any step ? Namely, we don't understand
if we've to create the json in some other way or using anything else.
Your help would be appreciated. Many thanks in advance. Best Regards.

Giuseppe Naldi

Backup does not work in Firefox

The Backup button does not appear to work in Firefox for applications in Qlik Desktop. To reproduce, open any app in the extension and click on the backup button.

Expected: the json file should start to download
Actual: nothing happens.

I stepped through the code and it appears that in the click handler at backup-and-restore.js:419, the method that is being used to download the blob (create an 'a' element, fill it with a new Blob[json], then click on it) doesn't work in Firefox.

Restore issue

I get this when trying to restore:

Uncaught (in promise) Object {code: 403, parameter: "REST HTTP error", message: "Forbidden"}

Backup all

Ability to backup all avaiilable apps

Restore not working

Hi

This is an essential extension! But I cannot get it to work :-) I'm using Qlik Sense Server 3.0.

I have been able to restore a tiny app with almost no content. But for apps with more content, the green spinner just continues forever when it tries to restore.

Also, I notice that the "Restore" button is only enabled when I have opened the the same app that I'm attempting to restore, using the open button in the user interface. This makes sense, because it stops people from restoring one app onto a different app. However, is it possible to handle the scenario where I want to restore an app that I don't have. (E.g. I have accidentally deleted it.) I did try to create a completely empty app, and restore an existing app onto it. (The Restore button allowed this.) However, I don't know whether it's working, since I cannot restore apps at all.

Thanks a lot for your feedback!
Tor

Hangs

I downloaded the extension. I imported it to the server. It said it was invalid but loaded it anyway. I opened up the extension in the mashup editor. I selected a qvf, and clicked open. It opened. I clidked the Backup button, and it just spins and never does anything.

backup-and-restore-hangs

I unzipped into and placed it in the Desktop's Extension folder. The same thing happens.

I placed an alert in backup-and-restore.js on line 494 right after $("#serialize").on("click", function () {
The alert never pops up.

I have a suspicion that there is either a conflict, or the "require" statement on line 21 is not working, or some other dependency has not been fulfilled.

Someone else I was working with had an old version of the extension. He isn't having any problems on his Desktop. He zipped it up and gave it to me, and the same thing happened, both on my Desktop and the server. I am also posting this on Alexander's page.

I am running with Qlik Sense 3.2 SR1 and Desktop 3.1 SR4.

No data available in table

Hi,
when we load an QlikSense App or after we backup an APP and load the backup JSON,
every time we do not see the elemts of the app. It says: "No data available in table"

no data available in table

We are using QlikSense 3.0.0.0 and would really love to use this VERY usefull plugin!

Experience with the April Release

Hi Stefan,

great extension. I tried to make a backup from a test-application by following the steps from Qlik Branch.
QS HUB -> DEV HUB -> Mashup “Backup and Restore” (right click “View”).
Then I see the html web surface. I choose the application, press open (and I get the message “test Application.qvf” open). I press the button “Backup”. The green circle starts to run. And it runs and runs (it’s a very small application).

image

Have I done something wrong? Or is it the April release or something else?
I have tried it with QS-Enterprise and Desktop – version.

Many many thanks in advance.
Daniel

Additional hanging topic at Restore

Hi Stefan,

thank you for the fixing advice of the previous backup hanging issue posted by claire. Backup now works fine.

Unfortunately we have an additional restore hanging issue.

After opening the backup file we get the message "For delete: x; For insert: y; For update: z". After pressing the "Restore" button the green spinning wheel is running endless, no message appears or anything else happens.

We are running Qlik Sense 3.2 and tested it on Desktop and Server. I've tested it also with a very simple backup file (corresponding to a new created empty app). Beside the 10.1 backup-and-restore app version we've tested it also with the 10.0 und 9.4 version. Same issue in 10.0. In 9.4 no "For delete ... insert ... update " message appears and the "Restore" button never becomes active.

The backup and restore app would be a tremendous value for us. We are very thankful for a fixing hint.

tom

issue on Backup?

Hi,
I'm trying this out but the backup button seems to be not working?
screen shot 2017-06-13 at 4 44 17 pm

After selecting and opening an app, clicked the Backup button. The animated progress gif just keeps in rotating and not giving any result.

Any idea how to fix this. My Qlik Sense version is 3.1

Thanks.

Hello

Hello,
I am really sorry to open an issue but I don't know how to join you...
My name is Maya and I am an apprentice. I would like to develop some extensions for my work but I don't know how to start and I am the only "computer scientist" in my service. I have nobody to ask and nobody to answer... Could you please help me ? Here is my address : [email protected]
Where can I join you ?
Thank you in advance !

Flatten promise chain

Not a bug or anything
But you could flatten the promise chain if you want to

        deleteObjects().then(function () {
            insertObjects().then(function () {
                updateObjects().then(function () {
                    setScript().then(function () {
                        setAppProperties().then(function () {
                            main.app.doSave().then(function () {
                                GenerateTable();
                                $('#loadingImg').css('visibility', 'hidden');
                            })
                        })
                    })
                })
            })
        })

to

deleteObjects()
.then( insertObjects() )
.then( updateObjects() )
.then( setScript() )
//etc

Just a tip :)

Can't backup with 0.10 beta

With version 0.10, I can see a list of apps, select and open one, but when I click Backup, the spinner goes on forever and no file is downloaded. Version 0.9.4 works fine. Tested as server plugin on Qlik Sense 3.0.4, browsers Chrome, IE, Firefox, and with Qlik Sense Desktop 3.1.3.

Cannot connect to QS Engine

When opening the mashup, no apps are shown, the green circle keeps spinning and next to it says "No active document".

I am already authenticated with Sense (Enterprise) on the same server where the Backup and Restore extension is running, but for some reason no connection is established to the QS Server.

Looking at the developer console in Chrome, a couple of errors are reported:

extensions::messaging:65
Uncaught Error: Attempting to use a disconnected port objectPortImpl.postMessage @ extensions::messaging:65target.(anonymous function) @ extensions::SafeBuiltins:19publicClass.(anonymous function) @ extensions::utils:94(anonymous function) @ cleekiagent.js:8555

qsocks.bundle.js:162 WebSocket is already in CLOSING or CLOSED state.(anonymous function) @ qsocks.bundle.js:162tryCallTwo @ qsocks.bundle.js:1940doResolve @ qsocks.bundle.js:2066Promise @ qsocks.bundle.js:1960Connection.ask @ qsocks.bundle.js:156Global.getDocList @ qsocks.bundle.js:1256(anonymous function) @ backup-and-restore.js:457tryCallOne @ qsocks.bundle.js:1932(anonymous function) @ qsocks.bundle.js:1998flush @ qsocks.bundle.js:2648drainQueue @ qsocks.bundle.js:1849

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.