<?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: ReplaceDataSource not working in script in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624588#M20671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Christian,&lt;BR /&gt; &lt;BR /&gt;as far as I understood the "CURRENT" option is basically meant to be used from within the python-Window.&lt;BR /&gt;Try to parse the full mxd-Path as an argument into your script and make the document line get that&lt;BR /&gt; &lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument(r"C:\temp\xxtest.mxd")
&lt;/PRE&gt;&lt;BR /&gt; &lt;BR /&gt;Havent tried but its worth a try!&lt;BR /&gt;Regards&lt;BR /&gt;Guenter&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for this suggestion.&amp;nbsp; However, I've used "CURRENT" successfully in a number of other script tools.&amp;nbsp; Plus, I get the same result when I use the full mxd path.&amp;nbsp; I think this has to be a bug in the software.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 02:36:12 GMT</pubDate>
    <dc:creator>ChristianHalsted</dc:creator>
    <dc:date>2021-12-12T02:36:12Z</dc:date>
    <item>
      <title>ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624584#M20667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to write a script tool that will loop through all the disconnected layers in a map document and repoint them using the Layer.replaceDataSource function.&amp;nbsp; When I run the following 3 lines of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lyr = arcpy.mapping.ListBrokenDataSources(mxd)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lyr.replaceDataSource(r"Database Connections\GISUSER on dep-eia1dbsop01.sde","SDE_WORKSPACE",r"Sample_Location",True)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;from the Python Window within ArcGIS Desktop it works fine.&amp;nbsp; But when I put them in a .py file and try to run the script from ArcToolbox it seems to reconnect the file but then removes it from the map document.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jul 2010 11:10:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624584#M20667</guid>
      <dc:creator>ChristianHalsted</dc:creator>
      <dc:date>2010-07-20T11:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624585#M20668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Christian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;as far as I understood the "CURRENT" option is basically meant to be used from within the python-Window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try to parse the full mxd-Path as an argument into your script and make the document line get that&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument(r"C:\temp\xxtest.mxd")
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Havent tried but its worth a try!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Guenter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:36:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624585#M20668</guid>
      <dc:creator>GünterDörffel</dc:creator>
      <dc:date>2021-12-12T02:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624586#M20669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Question about saving the mxd.&amp;nbsp; Is there a way to determine the version of an mxd so when saving out the mxd it can be saved to the same version?&amp;nbsp; Our users are running mostly 9.3 but some have 9.2 mxds that break at 9.3 so they want their mxds fixed and saved to that version.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jul 2010 17:38:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624586#M20669</guid>
      <dc:creator>RandyKreuziger</dc:creator>
      <dc:date>2010-07-21T17:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624587#M20670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Randy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you should have opened a seperate thread for that ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I know of no python way to get this. ArcObjects I think to remember there is one ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In python you can use the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;saveACopy (file_name, {version})&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;method to save to a previous version - but unless you havent used any of the potential document properties to store a helper string in (like description, summary, tags ...) you will have to "guess" which version this is. Maybe the read-only property&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;dateSaved&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;could help to evaluate which version this is ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Guenter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 05:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624587#M20670</guid>
      <dc:creator>GünterDörffel</dc:creator>
      <dc:date>2010-07-22T05:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624588#M20671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Christian,&lt;BR /&gt; &lt;BR /&gt;as far as I understood the "CURRENT" option is basically meant to be used from within the python-Window.&lt;BR /&gt;Try to parse the full mxd-Path as an argument into your script and make the document line get that&lt;BR /&gt; &lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument(r"C:\temp\xxtest.mxd")
&lt;/PRE&gt;&lt;BR /&gt; &lt;BR /&gt;Havent tried but its worth a try!&lt;BR /&gt;Regards&lt;BR /&gt;Guenter&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for this suggestion.&amp;nbsp; However, I've used "CURRENT" successfully in a number of other script tools.&amp;nbsp; Plus, I get the same result when I use the full mxd path.&amp;nbsp; I think this has to be a bug in the software.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:36:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624588#M20671</guid>
      <dc:creator>ChristianHalsted</dc:creator>
      <dc:date>2021-12-12T02:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624589#M20672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I experience exactly the same problem and I have SP 1 installed...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd=arcpy.mapping.MapDocument('Current')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df= arcpy.mapping.ListDataFrames(..)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;old_lyr=arcpy.mapping.ListLayers(..)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;old_lyr.replaceDataSource(..)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;from withon the Pythonwin in Arcmap everything is fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I do the exactly the same in a script, it seems the layer changes(for a sec), but when the script finishes the layer disappears. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The best way in my opinion, is to remove the the layer from the dataframe, then to replace the datasource and finally to add the layer again into the dataframe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd=arcpy.mapping.MapDocument('Current')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df= arcpy.mapping.ListDataFrames(..)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;old_lyr=arcpy.mapping.ListLayers(..)&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.mapping.RemoveLayer(..)&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;old_lyr.replaceDataSource(..)&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.mapping.AddLayer(..) / InsertLayer(..)&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the shortest workaround I could find...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps, even though your post is quite old...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 19:38:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624589#M20672</guid>
      <dc:creator>CosminTana</dc:creator>
      <dc:date>2010-11-25T19:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624590#M20673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've had that problem recently. It occurs for me when I have multiple data frames that contain some of the same layers. I've fixed this by calling the layers inside the data frames like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
newSdePath = r"Database Connections\My Connection.sde"

for df in arcpy.mapping.ListDataFrames(mxd):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for lyr in arcpy.mapping.ListLayers(mxd, "", df):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.replaceDataSource(newSdePath, "SDE_WORKSPACE", lyr.datasetName, False)

arcpy.RefreshTOC()
arcpy.RefreshActiveView()
mxd.save()
del mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's also helpful to check that you can use the dataSource and datasetName functions on your layers before attempting replaceDataSource:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
newSdePath = r"Database Connections\My Connection.sde"

for df in arcpy.mapping.ListDataFrames(mxd):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for lyr in arcpy.mapping.ListLayers(mxd, "", df):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (lyr.supports("DATASOURCE") and lyr.supports("datasetName")):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.replaceDataSource(newSdePath, "SDE_WORKSPACE", lyr.datasetName, False)

arcpy.RefreshTOC()
arcpy.RefreshActiveView()
mxd.save()
del mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also had problems with the SDE paths, notably that my features were inside feature classes, and that I wanted to make sure that I was only replacing data sources that were in my old SDE (e.g. not in a file gdb on my local drive), so I came up with this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os
mxd = arcpy.mapping.MapDocument("CURRENT")
newSdePath = r"Database Connections\My Connection.sde"
oldSdePath = r"Database Connections\My Old Connection.sde"

for df in arcpy.mapping.ListDataFrames(mxd):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for lyr in arcpy.mapping.ListLayers(mxd, "", df):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (lyr.supports("DATASOURCE") and lyr.supports("datasetName")):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tempDataSetPath, tempDataSet = os.path.split(lyr.dataSource)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tempDataSetPath, tempDataSetClass = os.path.split(tempDataSetPath)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.dataSource == os.path.join(oldSdePath, tempDataSetClass, lyr.datasetName):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.replaceDataSource(newSdePath, "SDE_WORKSPACE", lyr.datasetName, False)

arcpy.RefreshTOC()
arcpy.RefreshActiveView()
mxd.save()
del mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this is useful.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:36:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624590#M20673</guid>
      <dc:creator>RuthEmerick</dc:creator>
      <dc:date>2021-12-12T02:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624591#M20674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for providing your code and sharing your experience.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't worked with SDE Connections yet, but if I ever have to, I now know where to look first for it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I was wrong, since SP1 is out, replaceDataSoruces works without removing and inserting the layer again. So it was only a bug before SP1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, this thread due to your code now, could help a lot of people. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 15:35:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624591#M20674</guid>
      <dc:creator>CosminTana</dc:creator>
      <dc:date>2011-02-08T15:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624592#M20675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In case anyone else tries to use the replaceDatasource function, there's a fairly significant problem if you try to change very many sde data sources at a time. See &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/23803-issues-updating-data-source-via-arcpy.mapping?p=78411&amp;amp;viewfull=1"&gt;this post&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Mar 2011 13:46:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624592#M20675</guid>
      <dc:creator>RuthEmerick</dc:creator>
      <dc:date>2011-03-22T13:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624593#M20676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having the same issue when running my python script.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It connects the layers fine, then immediately removes them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this a known bug?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2011 20:08:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624593#M20676</guid>
      <dc:creator>BrettElliot</dc:creator>
      <dc:date>2011-09-27T20:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: ReplaceDataSource not working in script</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624594#M20677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm having the same issue when running my python script.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;It connects the layers fine, then immediately removes them.&lt;BR /&gt;&lt;BR /&gt;Is this a known bug?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the same problem: after setting the source, the layer is removed from the TOC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What's happening?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greetings, Henk&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 13:15:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/replacedatasource-not-working-in-script/m-p/624594#M20677</guid>
      <dc:creator>HenkZwols</dc:creator>
      <dc:date>2011-11-14T13:15:56Z</dc:date>
    </item>
  </channel>
</rss>

