<?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 findAndReplaceWorkspacePaths for ArcSDE connections in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-for-arcsde/m-p/399360#M4368</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the findAndReplaceWorkspacePaths for ArcSDE databases in mxd's in a series of folders to update the 3 teir connections to Direct connections. The command I am using is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd.findAndReplaceWorkspacePaths(find_workspace_path=r"", replace_workspace_path=r"C:\Temp\arcsde_DIRECT.sde")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This works fine if I want to replace all the connections in the MXD.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the situation though where I have multiple people make mods to the mxd's and have the following list of connections strings:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Documents and Settings\Fred\Application Data\ESRI\ArcCatalog\Direct_vector.sde&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Documents and Settings\Fred\Application Data\ESRI\ArcCatalog\Direct_raster.sde&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Documents and Settings\Johnathon\Application Data\ESRI\ArcCatalog\Direct_vector.sde&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SERVER=production;INSTANCE=port:5152;USER=Johnathon;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Connections 1,3,4 are all the same database while 2 is a different database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way I can wildcard search for the direct_vector.sde (1,3,4) connection without Explicitly stating the path? For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd.findAndReplaceWorkspacePaths(find_workspace_path=r"*\ArcCatalog\Direct_vector.sde", replace_workspace_path=r"C:\Temp\arcsde_DIRECT.sde")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; and how can I use the findAndReplaceWorkspacePaths to update the 4th connection?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gordon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jul 2011 00:45:17 GMT</pubDate>
    <dc:creator>GordonSumerling</dc:creator>
    <dc:date>2011-07-28T00:45:17Z</dc:date>
    <item>
      <title>findAndReplaceWorkspacePaths for ArcSDE connections</title>
      <link>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-for-arcsde/m-p/399360#M4368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the findAndReplaceWorkspacePaths for ArcSDE databases in mxd's in a series of folders to update the 3 teir connections to Direct connections. The command I am using is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd.findAndReplaceWorkspacePaths(find_workspace_path=r"", replace_workspace_path=r"C:\Temp\arcsde_DIRECT.sde")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This works fine if I want to replace all the connections in the MXD.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the situation though where I have multiple people make mods to the mxd's and have the following list of connections strings:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Documents and Settings\Fred\Application Data\ESRI\ArcCatalog\Direct_vector.sde&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Documents and Settings\Fred\Application Data\ESRI\ArcCatalog\Direct_raster.sde&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Documents and Settings\Johnathon\Application Data\ESRI\ArcCatalog\Direct_vector.sde&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SERVER=production;INSTANCE=port:5152;USER=Johnathon;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Connections 1,3,4 are all the same database while 2 is a different database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way I can wildcard search for the direct_vector.sde (1,3,4) connection without Explicitly stating the path? For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd.findAndReplaceWorkspacePaths(find_workspace_path=r"*\ArcCatalog\Direct_vector.sde", replace_workspace_path=r"C:\Temp\arcsde_DIRECT.sde")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; and how can I use the findAndReplaceWorkspacePaths to update the 4th connection?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gordon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 00:45:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-for-arcsde/m-p/399360#M4368</guid>
      <dc:creator>GordonSumerling</dc:creator>
      <dc:date>2011-07-28T00:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: findAndReplaceWorkspacePaths for ArcSDE connections</title>
      <link>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-for-arcsde/m-p/399361#M4369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Gordon,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;findAndReplaceWorkspacePaths is very sensitive to the strings that you pass in because it is simply doing a find and replace.&amp;nbsp; In your cases below, the strings are different so you have to run the same function multiple times, once for each possible combination.&amp;nbsp; There are several ways to play with the strings to make them the same but that would be even more work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not familiar with your 4th workspace being a possible workspace path value.&amp;nbsp; That appears odd.&amp;nbsp; Another method to use would be the Layer class .replaceDataSource function.&amp;nbsp; This way you can simply override the original workspace with the new workspace.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A nice help topic that addresses these issues is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Updating_and_fixing_data_sources_with_arcpy_mapping/00s30000004p000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Updating_and_fixing_data_sources_with_arcpy_mapping/00s30000004p000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 13:38:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/findandreplaceworkspacepaths-for-arcsde/m-p/399361#M4369</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2011-07-28T13:38:52Z</dc:date>
    </item>
  </channel>
</rss>

