Hello,
Following this guide, https://pro.arcgis.com/en/pro-app/3.3/arcpy/mapping/updatingandfixingdatasources.htm
Trying to update the connection properties of multiple files. The new way works for the majority of the datasets (including FCs, Raster, FC with joins in them) except when it has tables. This works fine from one gdb to another gdb but it breaks for TABLES when gdb to sde.
aprx = arcpy.mp.ArcGISProject(r'some_aprx_path')
aprx.updateConnectionProperties(
local_gdb_path, # local gdb file where data currently reside
'sde_connection_file.sde', # SDE connection file
auto_update_joins_and_relates=True,
validate=True,
ignore_case=True
)
When I go to table and give a proper connection info (user, pwd, host etc) like below, it works.
old = table.connectionProperties.copy()
new = {
"authentication_mode": "dbms",
"database": 'db',
"dbclient": "sql",
"db_connection_properties": host, # The server
"instance": "instance with sde",
"server": host,
"user": 'usr',
"version": "",
"password": '****pwd',
}
table.updateConnectionProperties(old, new)
I was hoping all the dataset works the same way and not having to pass the connection info, instead just SDE ConnectionFile. It makes unit tests works better, since updateConnectionProperties from one gdb to another gdb works just file. Now I have to have a different path for the integration with connection string.
Thanks.