Forum Discussion
How to Migrate An Existing DataGateway with PowerShell
Normally, while taking over an existing gateway and setting it up in a new server, we disable it from the service and then we take it over in the new server while installing. This approach worked.
So I would suggest you to add the following command to disable it
Set-OnPremisesDataGateway
and then for installation your can leverage -overwriteexsitinggateway flag
ConvertFrom-SecureString -SecureString (Read-Host "Enter Recovery Key" -AsSecureString) | Out-File -FilePath .\encryptedRecoveryKey.txt
$secureRecoveryKey = (cat .\encryptedRecoveryKey.txt | ConvertTo-SecureString)
Add-DataGatewayCluster -RecoveryKey $secureRecoveryKey -Name "MyNewGateway" -RegionKey brazilsouth -OverwriteExistingGateway
I have not tried it from poweshell but I believe it works.
Need a Power BI Consultation? Hire me on Upwork
Connect on LinkedIn
|
hey tharunkumarRTK thanks for help. I tried the Add-DataGatewayCluster cmdlet before with -OverwriteExistingGateway option before which returns Add-DataGatewayCluster: Gateway data-gateway-test already exists error. From my understanding, overwrite flag is only for overriding the current gateway with a new name which is not the automated case that I am looking for. On the other hand, I think Set-DataGatewayCluster is not the cmdlet I am looking for because it only provides updating a couple of attributes. By the way, I am using PowerShell 7.4.4 which has different cmdlets than 5.1.