<?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: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112599#M8791</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think the replace datasource works when going from a GDB to SDE.&amp;nbsp; You can do replacements from PGDB to FGDB,&amp;nbsp; FGDB to FGDB,&amp;nbsp; FGDB to PGDB and&amp;nbsp; PGDB to PGDB when the feature class has the same name for example "county."&amp;nbsp; But at least in SQL Server the name in SDE is seen as "databasename.schema.county."&amp;nbsp; In our case GeoLib.DBO.County so the repair broken links in MXDs doesn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Aug 2015 18:20:11 GMT</pubDate>
    <dc:creator>RandyKreuziger</dc:creator>
    <dc:date>2015-08-06T18:20:11Z</dc:date>
    <item>
      <title>Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112592#M8784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all. We have a large task of replacing datasources for MANY feature classes and rasters (we received data from a consultant, and in order to place the data on the Client's enterprise server, all data has to conform to schema requirements). I have saved all of the data in their respective receptacles on the enterprise SDE environment. Now, I need to change the datasources within each of the mxds - this means every feature class in every mxd has to be relinked to the new name and location on the SDE. I want to do this with Python - naturally, otherwise task is beyond tedious.&lt;/P&gt;&lt;P&gt;So, I have my list of broken links, I have a table with name and location crosswalk for reference. I am not at all a Python guru and could really use some help in figuring out what the error below means (I feel like it has something to do with the enterprise SDE connection properties, but honestly don't know, especially since it is referencing my storage properties):&lt;/P&gt;&lt;P&gt;I have my broken list already, so am referencing that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; &lt;SPAN style="color: #004da8;"&gt;for&lt;/SPAN&gt; lyr &lt;SPAN style="color: #004da8;"&gt;in&lt;/SPAN&gt; brokenlist:&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #004da8;"&gt;if&lt;/SPAN&gt; lyr.supports ("DATASOURCE"):&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #004da8;"&gt;if&lt;/SPAN&gt; lyr.dataSource == "Y:\00726_11_BDCP\data\DHCCP_ENG_Rev10b\DHCCP_Eng_Rev10b.gdb\Option_Point_Features":&lt;/P&gt;&lt;P&gt;...&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 ("Y:\00726_11_BDCP\data\DHCCP_ENG_Rev10b\DHCCP_Eng_Rev10b.gdb\Option_Point_Features", "SDE_WORKSPACE", "C:\Users\cbowles\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\dhccp_eng.SDE.ER10b_Option_Point_Features")&lt;/P&gt;&lt;P&gt;... mapdoc.save ()&lt;/P&gt;&lt;P&gt;... &lt;SPAN style="color: #004da8;"&gt;del&lt;/SPAN&gt; mapdoc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;Runtime error &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 5, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\utils.py", line 181, in fn_&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return fn(*args, **kw)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\_mapping.py", line 801, in save&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return convertArcObjectToPythonObject(self._arc_object.save(*gp_fixargs((), True)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;IOError: MapDocObject: Unable to save.&amp;nbsp; Check to make sure you have write access to the specified file and that there is enough space on the storage device to hold your document.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;I appreciate all helpful comments.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;Crystal&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 22:13:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112592#M8784</guid>
      <dc:creator>CrystalSchiffbauer-Bowles1</dc:creator>
      <dc:date>2015-07-31T22:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112593#M8785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;P&gt;Do you have a list of broken links for all map documents, or just for one?&amp;nbsp; You really need to handle the broken links on a map by map basis, since each one will have its own list of layers to be fixed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a script I used, walks a workspace makes a list of maps, for each map lists layers and fixes the path designated, you should be able to modify it for replaceDataSource instead of findAndReplaceWorkspacePath&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#Importing Modules&amp;nbsp; 
import arcpy, os&amp;nbsp;&amp;nbsp; 
from arcpy import env
#Put file path for the folder containing mxds, where I have my sample file path&amp;nbsp; 
env.workspace = r"S:\TS Projects\Basemaps"
#Workspaces I want replaced
find_workspace_path = r"C:\Users\iamurray\Desktop\Export_Output"
find_workspace_path2 = r"C:\Users\iamurray\Desktop\ED_Remainder"
find_workspace_path3 = r"C:\Users\iamurray\Desktop\ED_Remainder2"
find_workspace_path4 = r"C:\Users\iamurray\Desktop\Export_Output2"
replace_workspace_path&amp;nbsp; = r"C:\Test\NewWorkspace" 
#Recursively walking workspace
for root, dirs, files in os.walk(env.workspace):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in files:
&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 f.endswith(".mxd"):
&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; mxd = arcpy.mapping.MapDocument(os.path.join(root , f))
&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; Layers = arcpy.mapping.ListLayers(mxd) 
&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; for Layer in Layers:
&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; if Layer.dataSource ==&amp;nbsp; find_workspace_path:
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layer.findAndReplaceWorkspacePath (find_workspace_path, replace_workspace_path)
&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; elif Layer.dataSource ==&amp;nbsp; find_workspace_path2:
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layer.findAndReplaceWorkspacePath (find_workspace_path2, replace_workspace_path)
&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; elif Layer.dataSource ==&amp;nbsp; find_workspace_path3:
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layer.findAndReplaceWorkspacePath (find_workspace_path3, replace_workspace_path)
&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; elif Layer.dataSource ==&amp;nbsp; find_workspace_path4:
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layer.findAndReplaceWorkspacePath (find_workspace_path4, replace_workspace_path)
&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; mxd.save()
&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; del mxd&amp;nbsp; &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:43:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112593#M8785</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2021-12-11T06:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112594#M8786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Ian. I am currently working on a map-to-map basis, since yes, as you mentioned, each one contains different layers.&lt;/P&gt;&lt;P&gt;I will certainly try yours. I had seen a similar post to yours on another site, but this one certainly seems easier to understand. Thank you for your help. Will let you know how it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Crystal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 23:09:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112594#M8786</guid>
      <dc:creator>CrystalSchiffbauer-Bowles1</dc:creator>
      <dc:date>2015-07-31T23:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112595#M8787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your layers have broken links then how does the code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #004da8;"&gt;if&lt;/SPAN&gt; lyr.dataSource == "Y:\00726_11_BDCP\data\DHCCP_ENG_Rev10b\DHCCP_Eng_Rev10b.gdb\Option_Point_Features":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;work, as I would expect lyr.dataSource to be NULL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 13:52:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112595#M8787</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2015-08-03T13:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112596#M8788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Typically the dataSource will not be NULL, but will be a location that it can no longer find and therefore will be broken.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.mapping.ListBrokenDataSources(mxd)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can give you a list of brokenlinks within an MXD.&amp;nbsp; I'm working on a toolbox (python addin) to help with this process since I have many that need to be updated, but it's a secondary project so I haven't finished polishing it yet.&amp;nbsp; I'm building in the ability to list and fix most if not all the data types since I have some very old mxd's that still point to coverages or did point to coverages and now need to point to FGDB, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, try the ListBrokenDatatSources command to see what it thinks the data sources are.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 18:15:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112596#M8788</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2015-08-03T18:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112597#M8789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ian. So, I have been troubleshooting the reason for my now WAY simplified code (I've gone to trying to get just 1 feature class w/in 1 mxd) runs, but the data source does not get updated. This is the code (I have gone to just trying to get the data source to change between geodatabases because I was getting no where with SDE):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapdoc = arcpy.mapping.MapDocument (r"Y:\HCP\_Template_HCP_Portrait_11x17_20120710.mxd")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; lyr &lt;SPAN style="color: #004da8;"&gt;in&lt;/SPAN&gt; arcpy.mapping.ListBrokenDataSources (mapdoc):&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #004da8;"&gt;if&lt;/SPAN&gt; lyr.supports ("DATASOURCE"):&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #004da8;"&gt;if&lt;/SPAN&gt; lyr.dataSource == r"Y:\00726_11_BDCP\data\BDCP_BaseMap2.gdb\ICF_Cities":&lt;/P&gt;&lt;P&gt;...&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 (r"T:\WGI-38\GIS_33_00\GISRequest_11F\Deliverable_10F\MGT096_13\GISFiles\BDCP_EIRS_HCP_15.gdb", "FILEGDB_WORKSPACE", "i13_BDCP_Cities_09")&lt;/P&gt;&lt;P&gt;... mapdoc.saveACopy (r"Y:\HCP\_Template_HCP_Portrait_11x17_20120710s.mxd")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said, the code runs, no errors, but none of the data is updated in the new or current mxd. Any ideas why this might be happening? I appreciate everyone's help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 20:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112597#M8789</guid>
      <dc:creator>CrystalSchiffbauer-Bowles1</dc:creator>
      <dc:date>2015-08-05T20:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112598#M8790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Crystal:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you saving a new mxd whether or not any datasources actually get updated?&amp;nbsp; I ask because I made sure that at least one (1) datasource was updated before I executed the SaveACopy command in a script I wrote that also replaced datasources.&amp;nbsp; I would add a counter to make sure you were actually updating a datasource before saving a new file.&amp;nbsp; Your if conditions might not be working and you are saving a new mxd even though no changes are being made to the mxd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would add some print statements to test whether your if conditions were actually being met.&amp;nbsp; I would try to verify that the paths to the files were being interpreted correctly as that always seem to be a troublesome area with python coding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 11:51:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112598#M8790</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2015-08-06T11:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112599#M8791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think the replace datasource works when going from a GDB to SDE.&amp;nbsp; You can do replacements from PGDB to FGDB,&amp;nbsp; FGDB to FGDB,&amp;nbsp; FGDB to PGDB and&amp;nbsp; PGDB to PGDB when the feature class has the same name for example "county."&amp;nbsp; But at least in SQL Server the name in SDE is seen as "databasename.schema.county."&amp;nbsp; In our case GeoLib.DBO.County so the repair broken links in MXDs doesn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 18:20:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112599#M8791</guid>
      <dc:creator>RandyKreuziger</dc:creator>
      <dc:date>2015-08-06T18:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112600#M8792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would think you could put conditional statements in so if a feature class has a name such as Roads it would go into the Transportation schema in SDE so the replaceDataSource line which currently is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; lyr.replaceDataSource ("Y:\00726_11_BDCP\data\DHCCP_ENG_Rev10b\DHCCP_Eng_Rev10b.gdb\Option_Point_Features", "SDE_WORKSPACE", "C:\Users\cbowles\AppData\Roaming\ESRI\Desktop10.2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; lyr.replaceDataSource ("SDE connection string\"Schema from conditional statement".Option_Point_Features", "SDE_WORKSPACE", "C:\Users\cbowles\AppData\Roaming\ESRI\Desktop10.2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so for Roads it would be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; lyr.replaceDataSource ("SDE connection string\Transportation.Roads", "SDE_WORKSPACE", "C:\Users\cbowles\AppData\Roaming\ESRI\Desktop10.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 18:29:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112600#M8792</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2015-08-06T18:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112601#M8793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to the help, you can switch workspace types with replaceDataSource.&amp;nbsp; The third parameter is the dataset name to be replaced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"A string that represents the name of the dataset the way it appears in the new workspace (not the name of the layer in the TOC). If &lt;SPAN class="arcpyref"&gt;dataset_name&lt;/SPAN&gt; is not provided, the &lt;SPAN class="arcpyref"&gt;replaceDataSource&lt;/SPAN&gt; method will attempt to replace the dataset by finding a table with a the same name as the layer's current dataset property."&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So yes you would need to provide the script with the databasename and schema for replaceDataSource to work properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Aug 2015 18:37:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112601#M8793</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-08-06T18:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112602#M8794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Michael. I have run some updated code. The first 3 layers were updated however, everything else after only had the lyr.name within TOC updated, where the actual properties of the data still shows the original data source. I am not sure why. I tried just updating single layers at a time, and I got the same result. I find it strange that their are no syntax errors and that the datasource is correct (since it's changing the name in the TOC), but not actually updating the properties. Any comments/ideas are much appreciated. Thank you, Crystal Bowles&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example of portion of code attached:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/122078_pastedImage_2.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/122079_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 18:11:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112602#M8794</guid>
      <dc:creator>CrystalSchiffbauer-Bowles1</dc:creator>
      <dc:date>2015-08-12T18:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112603#M8795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So, there apparently is known (though not-well documents) issues with arcpy and the replaceDataSource from one workspace to an SDE Workspace. ESRI customer support is trying to figure out the cause and perhaps answer. So... this issue has not been solved for replacing all Data Sources within to start with, a single mxd. I have been able to get a single feature class to update, sometimes, until it stops working... weird issues.&lt;/P&gt;&lt;P&gt;Anyway, here is the code that does work... &lt;EM&gt;sometimes:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; #import arcpython module&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; import arcpy&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; #define mapdocument&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument (r"CURRENT")&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; #ListLayers function to update DataSource&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; for lyr in arcpy.mapping.ListLayers(mxd):&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.supports ("DATASOURCE"):&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.dataSource == r"full fc file path":&lt;/P&gt;&lt;P&gt;...&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 (r"Database Connections\connection name.sde", "SDE_WORKSPACE", "name.sde.SDE.newFCname")&lt;/P&gt;&lt;P&gt;...&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.name = "FC name in TOC"&lt;/P&gt;&lt;P&gt;... del mxd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, good luck and happy GIS-ing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 20:24:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112603#M8795</guid>
      <dc:creator>CrystalSchiffbauer-Bowles1</dc:creator>
      <dc:date>2015-08-19T20:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112604#M8796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Happy Holidays all! So, this issue has not been resolved. We have a programmer working on the process - utilizing other code to see if it will work. We have yet to get any resolution. ESRI did put some effort into finding a solution, but to no avail. So... we are waiting to see what our programmer comes up with - to be honest, I have little hope it will work, as I have gone through and manually updated the data sources for more than 400 map documents since Sept. Sorry for not having a solution, but wanted to give an update anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy Christmas and New Year!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2015 18:59:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112604#M8796</guid>
      <dc:creator>CrystalSchiffbauer-Bowles1</dc:creator>
      <dc:date>2015-12-23T18:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy: replaceDataSource (from gdb to SDE w/ change in data source name)</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112605#M8797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you programmer hasn't looked at this already, you might want them to see how I did it.&amp;nbsp; Not perfect and I'll be making additional updates at some point (off that project right now). &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/55043"&gt;Python addin for data inventory and “broken-link” repair.&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2015 19:31:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-replacedatasource-from-gdb-to-sde-w-change/m-p/112605#M8797</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2015-12-23T19:31:37Z</dc:date>
    </item>
  </channel>
</rss>

