<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Change connection properties from EGDB to Feature Service in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1121525#M63108</link>
    <description>&lt;P&gt;Thanks for posting this journey! We are moving some of our data to hosted feature services and need a way to change the source in our existing maps. I've been going through these same exact problems (sometimes its nice not to feel alone)!&lt;/P&gt;&lt;P&gt;I also noticed that the updateConnectionProperties didn't remove the enterprise geodatabase specific parameters from the connection info portion of the connection properties dictionary. It would be nice to know if this is a bug or expected and we need to figure out another way to achieve this workflow. I believe it will become more common as folks move to using more hosted feature services.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for suggesting the remove and add layer as a workaround!&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;original connection properties:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;{'dataset': 'EGDB.OWNER.WorkOrders', 'workspace_factory': 'SDE', 'connection_info': {'authentication_mode': 'OSA', 'database': 'EGDB', 'dbclient': 'sqlserver', 'db_connection_properties': 'db_server', 'instance': 'sde:sqlserver:db_server', 'server': 'db_server', 'version': 'sde.DEFAULT'}}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;connection properties after using updateConnectionProperties to replace the enterprise geodatabase source to a service url:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;{'dataset': '1', 'workspace_factory': 'FeatureService', 'connection_info': {'authentication_mode': 'OSA', 'database': 'EGDB', 'dbclient': 'sqlserver', 'db_connection_properties': 'db_server', 'instance': 'sde:sqlserver:db_server', 'server': 'db_server', 'url': 'https://&amp;lt;serviceURL&amp;gt;/FeatureServer', 'version': 'sde.DEFAULT'}}&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 22:53:00 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-11-30T22:53:00Z</dc:date>
    <item>
      <title>Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1112948#M62865</link>
      <description>&lt;P&gt;I have a number of ArcGIS Pro projects where I need to change one layer that used to be a feature class in our EGDB (aka SDE) to a feature service.&lt;/P&gt;&lt;P&gt;The &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_self"&gt;online help&lt;/A&gt; provides various approaches and &lt;A href="https://community.esri.com/t5/arcgis-pro-questions/change-data-source-of-a-layer-with-arcpy-mp/td-p/1104410" target="_self"&gt;in this post&lt;/A&gt;,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/511200"&gt;@GaetanPRU&lt;/a&gt;&amp;nbsp;provides some code to update the connection properties of a shape file.&amp;nbsp; Following that lead:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# I have a list created a priori of my Pro projects:
for a in aprxList:
    aprx = arcpy.mp.ArcGISProject(a[0])
    map = aprx.listMaps("Live SDE")[0]
    layer = map.listLayers("MSD.SLCOMSD.AddressGridMSD")[0]
    cp = layer.connectionProperties&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I list cp, I get the dictionary of the connection properties:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;cp
{'dataset': 'MSD.SLCOMSD.AddressGridMSD',
 'workspace_factory': 'SDE',
 'connection_info': {'authentication_mode': 'DBMS',
  'database': 'myDB',
  'dbclient': 'sqlserver',
  'db_connection_properties': '"bla bla bla',
  'password': '&amp;lt;yeahRight&amp;gt;',
  'instance': '"sde:sqlserver:bla bla bla',
  'server': 'bla bla bla',
  'user': 'myUser',
  'version': 'sde.DEFAULT'}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I'm unsure as to what my next step is to update the connection properties to a feature service.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:13:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1112948#M62865</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-11-01T19:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1112951#M62866</link>
      <description>&lt;P&gt;Id look at a layers connection properties that is a feature service and compare what it is to what you have and update by the dictionary method.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:21:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1112951#M62866</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-11-01T19:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1112964#M62867</link>
      <description>&lt;P&gt;That's a great suggestion!&amp;nbsp; I'll post up what I find!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:47:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1112964#M62867</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-11-01T19:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1113027#M62868</link>
      <description>&lt;P&gt;After a couple hours of trial and error, I'm tossing in the towel and getting a cold adult beverage.&lt;/P&gt;&lt;P&gt;The online help describes using an existing dictionary and a replacement dictionary to update the properties.&amp;nbsp; I just can make sense of it.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject('N:\\GIS\\AddressDataManagement\\TestDir\\CUP2020_000038\\cup2020_000038.aprx')
m = aprx.listMaps()[0]
l = m.listLayers("MSD.SLCOMSD.AddressGridMSD")[0]

existingDict = {'connection_info': {'authentication_mode': 'DBMS',
                                    'db_connection_properties':'xxxdb',
                                    'instance':'sde:sqlserver:sxxxdb',
                                    'server': 'xxxdb',
                                    'dataset': 'MSD.SLCOMSD.AddressGridMSD',
                                    'workspace factory':'SDE'}}
    
replaceDict = {'connection_info': {'url':'https://xxx.org/server/rest/services/Hosted/AddressCoordinateGrid/FeatureServer'},
                                   'dataset': '0',
                                   'alias':'AddressCoordinateGrid',
                                   'workspace_factory':'FeatureService'}
l.updateConnectionProperties(existingDict,replaceDict)
aprx.saveACopy('N:\\GIS\\AddressDataManagement\\TestDir\\CUP2020_000038\\cup2020_000038NEW.aprx')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;When I run this as is, the properties of my feature layer looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoeBorgione_0-1635806231866.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26577i61229FDBF7EB25A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoeBorgione_0-1635806231866.png" alt="JoeBorgione_0-1635806231866.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Notice the value in the url row.&amp;nbsp; In the python code above, line 5 has &lt;STRONG&gt;&lt;EM&gt;'authentication_mode': 'DBMS'&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;: if I leave that part out, it won't make any updates at all; the feature layer in the TOC still has the red exclamation mark in front of it. But when I leave it in, I get the weird properties value shown above.&amp;nbsp; In closing for today, if I list the connection properties through arcpy, it shows the sde connection properties but the feature url :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;pprint.pprint(l.connectionProperties)
{'connection_info': {'authentication_mode': 'DBMS',
                     'database': 'xxx',
                     'db_connection_properties': '"xxxdb',
                     'dbclient': 'sqlserver',
                     'instance': '"sde:sqlserver:xxxdb',
                     'password': '&amp;lt;xxx&amp;gt;',
                     'server': 'xxxdb',
                     'url': 'https://xxx.org/server/rest/services/Hosted/AddressCoordinateGrid/FeatureServer',
                     'user': 'SLCOmsd',
                     'version': 'sde.DEFAULT'},
 'dataset': '0',
 'workspace_factory': 'FeatureService'}&lt;/LI-CODE&gt;&lt;P&gt;It appears to be pulling from the correct source, but I don't really want those other properties populated and I would really like the Properties pane to be accurate as well....&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 22:47:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1113027#M62868</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-11-01T22:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1113053#M62869</link>
      <description>&lt;P&gt;You'd think that it would remove the dictionary keys that are not in the update dict, but it looks like its just adding to it so I would take a copy of the old dict and '' the keys that would no longer apply as part of the new dictionary.&amp;nbsp; updateConnectionProperties seems like it is one of those methods that could use some deeper documentation/ more diverse examples.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 23:48:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1113053#M62869</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-11-01T23:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1113117#M62870</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;If you want have the same properties you can use the CIM properties of an other layer to update it. It's a python object with all specifications about data connection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject('N:\\GIS\\AddressDataManagement\\TestDir\\CUP2020_000038\\cup2020_000038.aprx')
m = aprx.listMaps()[0]
l = m.listLayers("MSD.SLCOMSD.AddressGridMSD")[0]
new_l = m.listLayers("xxxxxxxxxxxxxxxx")[0]

l_CIM = l_CIM.getDefinition("V2")
new_l_CIM = new_l.getDefinition("V2")

l_CIM.featureTable.dataConnection = new_l_CIM.featureTable.dataConnection

l.setDefinition(l_CIM)

aprx.saveACopy('N:\\GIS\\AddressDataManagement\\TestDir\\CUP2020_000038\\cup2020_000038NEW.aprx')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/fr/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm#ESRI_SECTION1_DD16BE1F4AC54F078A04C84BD22C8D9B" target="_self"&gt;Online help&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But you must have the referenced layer somewhere in your project. If you have many differents layers it may take a while.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;EDIT:&lt;/P&gt;&lt;P&gt;I have the same issue than you if I use updateConnectionProperties() method.&lt;/P&gt;&lt;P&gt;I tried by copying directly connection properties from layer to the other and I have &lt;STRONG&gt;&lt;EM&gt;'authentication_mode': 'DBMS'&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;too&lt;/P&gt;&lt;LI-CODE lang="python"&gt;layer.updateConnectionProperties(layer.connectionProperties, new_layer.connectionProperties)&lt;/LI-CODE&gt;&lt;P&gt;I think it's a bug or we can't update workspace_factory SDE to FeatureService.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 10:10:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1113117#M62870</guid>
      <dc:creator>GaetanPRU</dc:creator>
      <dc:date>2021-11-02T10:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1113195#M62871</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/511200"&gt;@GaetanPRU&lt;/a&gt;&amp;nbsp;-&amp;nbsp; the problem I see with using another layer for the CIM properties is I'd have to add the reference layer to the set of project files and that essentially defeats the purpose.&amp;nbsp; Now as I type this, I wonder if a better way would be to simply delete the existing Egdb layer and replace it with the Feature Service Layer...&lt;/P&gt;&lt;P&gt;.&lt;STRONG&gt;&lt;EM&gt;..&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;I think it's a bug or we can't update workspace_factory SDE to FeatureService...&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Pretty much what I've been thinking too.&amp;nbsp; I mean, ESRI is pushing hosted feature services and with good reason However there needs to be an efficient set of tools &lt;STRONG&gt;that work&lt;/STRONG&gt; and allow us to migrate from the old days of direct connection data bases to the modern approach of hosted feature services.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This from a guy with one foot out the door because he:&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 16:23:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1113195#M62871</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-11-02T16:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1113273#M62877</link>
      <description>&lt;P&gt;Removing and replacing seems to do the trick.&amp;nbsp; We have a cloud based ArcGIS Server to which we publish data, and then we point back to it for an item in our AGOL.&amp;nbsp; Here is the code that I got to work for me:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
aprx = arcpy.mp.ArcGISProject('N:\\GIS\\AddressDataManagement\\TestDir\\CUP2020_000038\\cup2020_000038.aprx')
m = aprx.listMaps()[0]
rmlyr = m.listLayers("MSD.SLCOMSD.AddressGridMSD")[0]

m.removeLayer(rmlyr)

#addlyr = r'https://name/server/rest/services/Hosted/AddressCoordinateGrid/FeatureServer/0'

addlyr = r'https://ourAgol/home/item.html?id=################'

m.addDataFromPath(addlyr)
aprx.saveACopy('N:\\GIS\\AddressDataManagement\\TestDir\\CUP2020_000038\\cup2020_000038NEW.aprx')&lt;/LI-CODE&gt;&lt;P&gt;Lines 10 and 12 are the same data in our case: this just illustrates that the addDataFromPath can take an ArcGIS Enterprise rest end or and AGOL item.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 16:22:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1113273#M62877</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-11-02T16:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1121525#M63108</link>
      <description>&lt;P&gt;Thanks for posting this journey! We are moving some of our data to hosted feature services and need a way to change the source in our existing maps. I've been going through these same exact problems (sometimes its nice not to feel alone)!&lt;/P&gt;&lt;P&gt;I also noticed that the updateConnectionProperties didn't remove the enterprise geodatabase specific parameters from the connection info portion of the connection properties dictionary. It would be nice to know if this is a bug or expected and we need to figure out another way to achieve this workflow. I believe it will become more common as folks move to using more hosted feature services.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for suggesting the remove and add layer as a workaround!&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;original connection properties:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;{'dataset': 'EGDB.OWNER.WorkOrders', 'workspace_factory': 'SDE', 'connection_info': {'authentication_mode': 'OSA', 'database': 'EGDB', 'dbclient': 'sqlserver', 'db_connection_properties': 'db_server', 'instance': 'sde:sqlserver:db_server', 'server': 'db_server', 'version': 'sde.DEFAULT'}}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;connection properties after using updateConnectionProperties to replace the enterprise geodatabase source to a service url:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;{'dataset': '1', 'workspace_factory': 'FeatureService', 'connection_info': {'authentication_mode': 'OSA', 'database': 'EGDB', 'dbclient': 'sqlserver', 'db_connection_properties': 'db_server', 'instance': 'sde:sqlserver:db_server', 'server': 'db_server', 'url': 'https://&amp;lt;serviceURL&amp;gt;/FeatureServer', 'version': 'sde.DEFAULT'}}&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 22:53:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1121525#M63108</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-11-30T22:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1148506#M63887</link>
      <description>&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;Here is the simple solution, after a couple of research I found properties are updating correctly for me. You missed to add other properties from existingDict to replaceDict and set its value to an empty string, like in the sample below. Try it and see the magic.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;replaceDict = lyr.connectionProperties
replaceDict["dataset"] = str(dsID)
replaceDict["workspace_factory"] = "FeatureService"
replaceDict["connection_info"]["url"] = str(baseURL)
replaceDict["connection_info"]["authentication_mode"] = ""
replaceDict["connection_info"]["dbclient"] = ""
replaceDict["connection_info"]["db_connection_properties"] = ""
replaceDict["connection_info"]["password"] = ""
replaceDict["connection_info"]["instance"] = ""
replaceDict["connection_info"]["server"] = ""
replaceDict["connection_info"]["user"] = ""
replaceDict["connection_info"]["version"] = ""
lyr.updateConnectionProperties(lyr.connectionProperties, replaceDict)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 10:27:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1148506#M63887</guid>
      <dc:creator>arunachalammak</dc:creator>
      <dc:date>2022-02-28T10:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1148509#M63889</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Here is the simple solution, after a couple of research I found properties are updating correctly for me. You missed to add other properties from existingDict to replaceDict and set its value to an empty string, like in the sample below. Try it and see the magic.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;replaceDict = lyr.connectionProperties
replaceDict["dataset"] = str(dsID)
replaceDict["workspace_factory"] = "FeatureService"
replaceDict["connection_info"]["url"] = str(baseURL)
replaceDict["connection_info"]["authentication_mode"] = ""
replaceDict["connection_info"]["dbclient"] = ""
replaceDict["connection_info"]["db_connection_properties"] = ""
replaceDict["connection_info"]["password"] = ""
replaceDict["connection_info"]["instance"] = ""
replaceDict["connection_info"]["server"] = ""
replaceDict["connection_info"]["user"] = ""
replaceDict["connection_info"]["version"] = ""
lyr.updateConnectionProperties(lyr.connectionProperties, replaceDict)&lt;/LI-CODE&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 10:37:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1148509#M63889</guid>
      <dc:creator>arunachalammak</dc:creator>
      <dc:date>2022-02-28T10:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1148571#M63890</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/461878"&gt;@arunachalammak&lt;/a&gt;&amp;nbsp;- Thanks for your suggestion! &amp;nbsp;I retired at the end of 2021 and haven’t written a line of Python since!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 14:25:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1148571#M63890</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2022-02-28T14:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Change connection properties from EGDB to Feature Service</title>
      <link>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1309251#M68198</link>
      <description>&lt;P&gt;I'm running into this same issue in ArcGIS Pro 3.1.2. Figured it was a bug, and glad I found this thread as it was very helpful. Posting code here to hopefully help someone else.&lt;/P&gt;&lt;P&gt;This code specifically re-sources a layerfile as we have different symbology in ArcGIS Pro and simply removing and replacing the layer with the symbology from the feature service is not what we want.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Get AGOL Layer information
new_cp = agol_lyr.connectionProperties
new_cp['connection_info']['dataset'] = '0'
new_cp['connection_info']['alias'] = 'Layer Alias'
new_cp['connection_info']['workspace_factory'] = 'FeatureService'

for lyr in temp_m.listLayers()[2:]:
    old_cp_info = lyr.connectionProperties['connection_info']
    # if the key in the original connection_info is not in the new cp
    # add the key as a blank value to the new cp
    for key in old_cp_info:
        if key not in list(new_cp['connection_info'].keys()):
            new_cp['connection_info'][key] = ''
    lyr.updateConnectionProperties(lyr.connectionProperties,
                                   new_cp)
    print(lyr.connectionProperties)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would be great if this was fixed sometime soon.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 19:35:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-connection-properties-from-egdb-to-feature/m-p/1309251#M68198</guid>
      <dc:creator>DorothyShreve</dc:creator>
      <dc:date>2023-07-18T19:35:04Z</dc:date>
    </item>
  </channel>
</rss>

