We are migrating server, and I would like to move over several published datasource to point at the new SQL server, rather than the old one.
I am not well versed in python, so hopefully this is just something small that I have overlooked. I could do this manually, but I would like to script this, as it may also be helpful in the future for moving from dev to live environments.
Here is what I have tried so far:
import tableauserverclient as TSC
server = TSC.Server('https://server', use_server_version=True)
tableau_auth = TSC.TableauAuth('username', 'password')
datasource = server.datasources.get_by_id('datasource_id_string')
#I got the datasource_id_string earlier on, I'm testing it against a specific one.
datasource.connections.server_address = 'new ip'
datasource.connections.username = 'user'
datasource.connections.password = 'password'
datasource.connections.embed_password = True
I received back:
<tableauserverclient.models.datasource_item.DatasourceItem object at id_string>
I notice the datasource connections has not changes.
datasource.connections.server_address = (old ip)
I have tried the following, but I don't think I have had the context correct:
I then tried server.datasources.update_connection(datasource,datasource.connections) but this also seems to not be updating the connection.
Based on API reference
Is anybody able to assist on this?
Thank you in advance.
This might be something to take a look at