<?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: Pyhton script for changing datasource in MXD in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301591#M23435</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This may be incorrect because I am just reading into your variable names...but the third parameter of 'replaceDataSource' should be {dataset_name} and not a file path: &lt;/SPAN&gt;&lt;STRONG&gt;replaceDataSource (workspace_path, workspace_type, {dataset_name}, {validate})&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This resource will be helpful for mixing broken data sources if you have not seen it already:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Updating and fixing data sources with arcpy.mapping (arcpy.mapping)&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Updating_and_fixing_data_sources_with_arcpy_mapping/00s30000004p000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/Updating_and_fixing_data_sources_with_arcpy_mapping/00s30000004p000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jan 2014 12:35:20 GMT</pubDate>
    <dc:creator>AdamMarinelli</dc:creator>
    <dc:date>2014-01-03T12:35:20Z</dc:date>
    <item>
      <title>Pyhton script for changing datasource in MXD</title>
      <link>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301590#M23434</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 wanted to change the datasource of layers in my mxd but my script is not doing this. I am using below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;lyr.replaceDataSource(layer.workspacePath,"SDE_WORKSPACE",newFeatureclassPath, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help if anybidy has done this before.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 11:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301590#M23434</guid>
      <dc:creator>DianaVettori</dc:creator>
      <dc:date>2014-01-03T11:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Pyhton script for changing datasource in MXD</title>
      <link>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301591#M23435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This may be incorrect because I am just reading into your variable names...but the third parameter of 'replaceDataSource' should be {dataset_name} and not a file path: &lt;/SPAN&gt;&lt;STRONG&gt;replaceDataSource (workspace_path, workspace_type, {dataset_name}, {validate})&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This resource will be helpful for mixing broken data sources if you have not seen it already:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Updating and fixing data sources with arcpy.mapping (arcpy.mapping)&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Updating_and_fixing_data_sources_with_arcpy_mapping/00s30000004p000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/Updating_and_fixing_data_sources_with_arcpy_mapping/00s30000004p000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 12:35:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301591#M23435</guid>
      <dc:creator>AdamMarinelli</dc:creator>
      <dc:date>2014-01-03T12:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pyhton script for changing datasource in MXD</title>
      <link>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301592#M23436</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 appreciate your quick reply. thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;below is the parameters i am passing but still facing the issue.No idea what i am doing wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; layer.ReplaceDatasource(FeatureDatasetPath", "SDE_WORKSPACE", "featureclassName",False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FeatureDatasetPath(Path of featuredataset where featureclass resides) =r "\\server\Database Connections\dataLatest" &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;featureclassName=r"roadLatest"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what i am passing as parameters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:15:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301592#M23436</guid>
      <dc:creator>DianaVettori</dc:creator>
      <dc:date>2014-01-03T14:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pyhton script for changing datasource in MXD</title>
      <link>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301593#M23437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try changing the &lt;/SPAN&gt;&lt;STRONG&gt;workspace_path&lt;/STRONG&gt;&lt;SPAN&gt; parameter of the method to point to the actual '.sde' file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example:&amp;nbsp; r "\\server\Database Connections\dataLatest&lt;/SPAN&gt;&lt;STRONG&gt;.sde&lt;/STRONG&gt;&lt;SPAN&gt;" &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To be sure you get the path and file extension correct, click on the database name in the Database Connections folder of the Catalog window of ArcMap.&amp;nbsp; Copy the path location name from the address bar at the top of the window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt;&lt;SPAN&gt;: the &lt;/SPAN&gt;&lt;STRONG&gt;workspace_path&lt;/STRONG&gt;&lt;SPAN&gt; should point to the connection file (*.sde) and does not point to the file path of the feature dataset that your feature class is in.&amp;nbsp; This seems to throw an error for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an error message when you run the code in ArcMap?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 16:22:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301593#M23437</guid>
      <dc:creator>AdamMarinelli</dc:creator>
      <dc:date>2014-01-03T16:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pyhton script for changing datasource in MXD</title>
      <link>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301594#M23438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What works for me is to get the complete file path from ArcCatalog. Right click on the sde database and click "properties" and use the full path name under the General Tab: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Name: C:\Users\ComputerName\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\***.sde.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 20:59:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301594#M23438</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2014-01-03T20:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Pyhton script for changing datasource in MXD</title>
      <link>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301595#M23439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi amarinelli ,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is working now... Thank you for the support&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 11:25:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301595#M23439</guid>
      <dc:creator>DianaVettori</dc:creator>
      <dc:date>2014-01-06T11:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Pyhton script for changing datasource in MXD</title>
      <link>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301596#M23440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For the .sde file for the database connection, is anyone trying to create this on the fly where a parameter of the connection might be changing such as the instance (e.g. sde:oracle10g:"SID" to sde:oracle11g:"SID")? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to perform this operation at v10.2 and it is taking between 29-35 seconds for the .sde file to be written to disk.&amp;nbsp; This same operation took a split second at v10.0.&amp;nbsp; This is a problem because I have over 200,000 sde connections to change in 10s of thousands of mxds and lyr files.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 11:48:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyhton-script-for-changing-datasource-in-mxd/m-p/301596#M23440</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-01-06T11:48:37Z</dc:date>
    </item>
  </channel>
</rss>

