Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Mr_Pearl
Creator II
Creator II

Data Connection migration

Hi,

I am trying to migrate Data connection from one Qlik Sense Enterprise environment (installed in Windows server 2016) to another new Qlik sense enterprise. How do I do it?

- I do not see "export" for data connection in QMC.

- I tried to install Qlik sense desktop in my Windows server 2016 OS and try my possibility of success, but unfortunately, there is no Qlik sense desktop that could be installed in in Windows server 2016.

- I installed Qlik sense desktop in another server (which is windows 10) and logged in through desktop/client authentication link, yet that doesn't seem to fetch data connection from Qlik Sense enterprise.

- Tried exporting/importing app through QRS API, hoping that exports app with data connection, but unfortunately it does not.

- I searched through Qlik forum but not able to find any solution

These data connections (around 200 data connection) are created by lot of people from different departments in our organization. It is nearly impossible to recreate all the data connection manually.

Any help is much appreciated. Thank you.

Labels (2)
1 Solution

Accepted Solutions
Levi_Turner
Employee
Employee

There are a ton of variables at play here. The Data Connection itself is basically just a reference, right? For folders it points to a path (e.g. C:\data\ or \\server\data). For OLE DB / ODBC connections, it points to drivers or DSNs. For the remaining Qlik connections (Qlik's ODBC Driver, REST, Salesforce, etc) it'll be more straight-forward.

So this process will move the structure of the data connections but nothing else. For this process we'll use this script:

 

# Define your two servers
$server1 = '<myServer1>'
$server2 = '<myServer2>'

# Connect to server1
Get-PfxCertificate .\server1.pfx | Connect-Qlik -ComputerName $server1 -UserName INTERNAL\sa_api -TrustAllCerts

# Get all data connections which are _not_ owned by INTERNAL accounts
$sourceDataConnections = Get-QlikDataConnection -filter "owner.userDirectory ne 'INTERNAL'" -Full

# Validate $sourceDataConnections.Count

# Connect to server2
Get-PfxCertificate .\server2.pfx | Connect-Qlik -ComputerName $server2 -UserName INTERNAL\sa_api -TrustAllCerts

# Create data connections on server2 from server1
ForEach($dataConnection in $sourceDataConnections) {
    New-QlikDataConnection -name $dataConnection.name -connectionstring $dataConnection.connectionString -type $dataConnection.type -username $dataConnection.username -password $dataConnection.password -architecture $dataConnection.architecture -logOn $dataConnection.logOn
}

 

 

Notes

  •  I called it out in the video but I am not handling ownership of the newly created data connections since it's pretty complicated in some sense (you'd need to check if the user exists, create if necessary, etc). So this will need to be a manual process. But this script will move the data connection structure.
  • Same for custom properties / tags. You'll need to create those manually since error handling these is non-trivial.
  • This will not bring any security rules which drive entitlements. Those will need to be re-built from scratch, to be honest. Given how security rules can scope to all of a type of thing (DataConnection_*) OR a specific thing (e.g. DataConnection_7057dcf5-0dd8-494b-a25b-29168cb2950f). Handling this will be non-trivial.
  • We are using certificates to trust the connection. This is needed to retrieve any secrets like passwords. These are only revealed when using certificates and one of the internal accounts (we are using INTERNAL\sa_api).

 

All the non-trivial things could be done, of course. I just haven't done it and creating it from scratch would require more cycles than I have handy 😀

Cheers

View solution in original post

12 Replies
Levi_Turner
Employee
Employee

Can you explain a bit more what the hiccup was with the QRS API approach?

At its core, Data Connections are distinctively separate entities from Qlik apps in Qlik Sense Enterprise. This means that an app, from an easily discernable metadata standpoint, has no logical relationship to Data Connections.

If the end-goal is to move Data Connections from one site to another, then the QRS API approach is the obvious one.

Mr_Pearl
Creator II
Creator II
Author

@Levi_Turner  Thank you for your response. Using QRS API I migrated apps from one site to another site, hoping data connection will accompany the app. But apparently not. Is there a way to migrate data connection using QRS API??if so, can you please let me know path (QRS API) to export data connection from old server and QRS API path to import data connection to new server. THANK YOU IN ADVANCE 🙂

Mr_Pearl
Creator II
Creator II
Author

@Levi_Turner  is there any update to this issue? I am stuck and couldn't move forward with Qlik migration without moving the Data Connections to the new server. From your comment I guess there is QRS API for exporting/importing data connection, Can you please let me know what is the path?

 

Levi_Turner
Employee
Employee

There are a ton of variables at play here. The Data Connection itself is basically just a reference, right? For folders it points to a path (e.g. C:\data\ or \\server\data). For OLE DB / ODBC connections, it points to drivers or DSNs. For the remaining Qlik connections (Qlik's ODBC Driver, REST, Salesforce, etc) it'll be more straight-forward.

So this process will move the structure of the data connections but nothing else. For this process we'll use this script:

 

# Define your two servers
$server1 = '<myServer1>'
$server2 = '<myServer2>'

# Connect to server1
Get-PfxCertificate .\server1.pfx | Connect-Qlik -ComputerName $server1 -UserName INTERNAL\sa_api -TrustAllCerts

# Get all data connections which are _not_ owned by INTERNAL accounts
$sourceDataConnections = Get-QlikDataConnection -filter "owner.userDirectory ne 'INTERNAL'" -Full

# Validate $sourceDataConnections.Count

# Connect to server2
Get-PfxCertificate .\server2.pfx | Connect-Qlik -ComputerName $server2 -UserName INTERNAL\sa_api -TrustAllCerts

# Create data connections on server2 from server1
ForEach($dataConnection in $sourceDataConnections) {
    New-QlikDataConnection -name $dataConnection.name -connectionstring $dataConnection.connectionString -type $dataConnection.type -username $dataConnection.username -password $dataConnection.password -architecture $dataConnection.architecture -logOn $dataConnection.logOn
}

 

 

Notes

  •  I called it out in the video but I am not handling ownership of the newly created data connections since it's pretty complicated in some sense (you'd need to check if the user exists, create if necessary, etc). So this will need to be a manual process. But this script will move the data connection structure.
  • Same for custom properties / tags. You'll need to create those manually since error handling these is non-trivial.
  • This will not bring any security rules which drive entitlements. Those will need to be re-built from scratch, to be honest. Given how security rules can scope to all of a type of thing (DataConnection_*) OR a specific thing (e.g. DataConnection_7057dcf5-0dd8-494b-a25b-29168cb2950f). Handling this will be non-trivial.
  • We are using certificates to trust the connection. This is needed to retrieve any secrets like passwords. These are only revealed when using certificates and one of the internal accounts (we are using INTERNAL\sa_api).

 

All the non-trivial things could be done, of course. I just haven't done it and creating it from scratch would require more cycles than I have handy 😀

Cheers

Mr_Pearl
Creator II
Creator II
Author

@Levi_Turnerthat worked like a charm. Your explanation is very clear and concise and I couldn't have done it without your video. Thank you for taking effort and helping me out. I am sure your explanation is going to help lot of people. Much APPRECIATE your help. 😊

VigneshR
Contributor
Contributor

I followed your steps which you mentioned in that video, but I am not able to find the destination server  port .

can you please help me with this ?

 

Levi_Turner
Employee
Employee

It will use port 4242 but that is handled by the Connect-Qlik command. The input variable is just a hostname.

Vignesh91
Contributor
Contributor

Hi levi,

I followed the steps you have mentioned in that video. But what the issue is I am getting Tcp connection failed message. can u please help me with this ?

I pinned the picture of  my issue below, 2021-11-01_15h18_44.png

Levi_Turner
Employee
Employee

Test-NetConnection is a generic PowerShell function, right? So this has nothing to do with Qlik-Cli-Windows or Qlik Sense itself. The likely causes:

  • The Windows Firewall does not have 4242 open
  • Some network firewall does not have 4242 permitted between you and the server