Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy Qlik Server #206

Open
mattiasthalen opened this issue Apr 11, 2023 · 4 comments
Open

Copy Qlik Server #206

mattiasthalen opened this issue Apr 11, 2023 · 4 comments

Comments

@mattiasthalen
Copy link

Is there a way to use qlik-cli-windows to copy apps / streams from one server to another? We have a test server that we want to run as a copy of our production server.

Today I'm just copying the QlikShare folder and the QDF.

@mountaindude
Copy link

mountaindude commented Apr 13, 2023

First: I am a huge fan of Qlik-Cli-Windows and use it daily in various shapes and forms. Absolutely awesome tool.

But there are also more complex use cases that I have found difficult to automate using Qlik-Cli-Windows and/or Qlik's official Qlik CLI tool, especially when it comes to interacting with the Engine API.
Which is why I created Ctrl-Q, which is an open source tool that tries to automate some of those more complex scenarios.

App export and (re-)import is one such feature.
One command exports apps to QVF files, another command exports complete reload task definitions to and an Excel file.
A third command can then import those QVFs and task definitions into the same - or another - Sense server.
The target use case is to enabled reload-tasks-as-code, i.e. define complex task chains in an easy-to-understand format (the Excel file), then create those tasks and triggers automatically. And importing QVFs too if needed.

Again, I don't mean to steal the show from Adam's tool.. but if you're lazy like me, Ctrl-Q might be useful.

By the way, a step-by-step instruction for doing the above is available in this blog post:
The lazy Qlik developer #3: Bulk export/import of both apps and reload tasks.

@ahaydon
Copy link
Owner

ahaydon commented May 2, 2023

Copying apps from one server to another can be done by exporting the apps and then importing them on the other server. To copy all apps and streams you would need to get a list of all streams and then use a loop or pipeline to create them on the target, the same can be done for apps using export and import commands.

@mattiasthalen
Copy link
Author

I'm back at it and have a working script for exporting and then importing apps.
What I'm wondering now is how I export an app and import it with it have the same ID as it has in the export system.

We have apps linking to each other by IDs, and having them remain is critical.

@ahaydon
Copy link
Owner

ahaydon commented Nov 1, 2023

To import an app with a specific ID you need to first place the QVF in the Apps directory of the cluster share and rename it to just the ID without any file extension, then you call POST the app metadata to the /qrs/app endpoint to create the reference in the repository. These steps should be completed in the order I mention them here, otherwise you will need to restart services before you can use the app.

Assuming you read the app metadata using something like $app = Get-QlikApp 4701d35d-f836-47a0-9b06-00a7202032f6 -raw, you can use the following command to create the app in the repo.

Invoke-QlikPost /qrs/app ($app | ConvertTo-Json -Depth 10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants