Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Hi Levi,
Thanks for the reply. Could you please provide any other alternative solution for me. I am trying to move data connection from old server to the new server.
Thanks,
Not really, no*. You can always run the script on the server itself where presumably the port is available.
* If you want to re-enter the passwords then this change may do the job (I have not tested it):
# Define your two servers
$server1 = '<myServer1>'
$server2 = '<myServer2>'
# Connect to server1
Connect-Qlik -ComputerName $server1 -UseDefaultCredentials -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
Connect-Qlik -ComputerName $server2 -UseDefaultCredentials -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 -architecture $dataConnection.architecture -logOn $dataConnection.logOn
}
In the #create connections section I run into issues whenever there are null values for the password. Is there a way to filter these out?
Hello everyone (@Levi_Turner ),
I'm having an issue with this PowerShell script, to which I added code to set a customProperties "myCP." When I try to copy the customProperty to the new DataConnection, I get warnings stating that the property @{definition} cannot be found.
Here's an excerpt from the script and the error messages :
ForEach($dataConnection in $sourceDataConnections) {
Write-Host "Data Connection: $($dataConnection.name)"
Write-Host "Custom Properties: $($dataConnection.customProperties | Out-String)"
$customProperties = @()
if ($dataConnection.customProperties -ne $null) {
foreach ($property in $dataConnection.customProperties) {
Write-Host "CustomProperties Name: $($property.definition.name), CustomProperties Value: $($property.value)"
if ($property.definition.name -eq 'myPersonalDC') {
$customProperties += [PSCustomObject]@{
definition = @{
name = 'myPersonalDC'
}
value = $property.value
}
Write-Host "customProperties - DirectionEntite: $($property.value) pour la DC : $($dataConnection.name)"
}
}
}
Write-Host "Creating Data Connection: $($dataConnection.name) with Custom Properties: $($customProperties | ConvertTo-Json)"
New-QlikDataConnection -name $dataConnection.name -connectionstring $dataConnection.connectionString -type $dataConnection.type -username $dataConnection.username -password $dataConnection.password -architecture $dataConnection.architecture -logOn $dataConnection.logOn -customProperties $customProperties
}
Errors:
WARNING: Property with name '@{definition' not found
I also get warnings regarding the use of the username and password parameters, which are deprecated.
Has anyone encountered this issue before or could help me fix this script?
Thanks in advance for your help !
hi miche1394 !
the trick is to use an array to store the differents 'myPersonalDC':
$customProperties = @()
if ($dataConnection.customProperties -ne $null) {
foreach ($property in $dataConnection.customProperties) {
if ($property.definition.name -eq 'myPersonalDC') {
$cp = @("myPersonalDC=" + $property.value)
$customProperties += $cp
}
}
}