<?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: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387419#M30608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Go to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.esri.com/en/"&gt;http://support.esri.com/en/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you have an option to contact via email or by phone.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jan 2014 14:52:22 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2014-01-21T14:52:22Z</dc:date>
    <item>
      <title>mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Service</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387416#M30605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Our organization is migrating from SDE 9.3.1 to SDE 10.1 which entails new SDE connection files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've developed a script tool that walks a directory tree looking for MXD files that have an old SDE connection, and then replaces the old SDE connection(s) with the new SDE connection(s) using the .replaceWorkspaces() method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script works totally as expeted &lt;/SPAN&gt;&lt;STRONG&gt;except&lt;/STRONG&gt;&lt;SPAN&gt; for MXDs that contain an ArcGIS Image Service raster layer.&amp;nbsp; In these situations, the SDE connection to the vector data is successfully replaced but, somehow, that process strips all of the properties from the Image Service layers!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the attached image below, notice that the SDE connection has been updated to gdb01a as it should, but the Image Service layers are stripped of their source properties.&amp;nbsp; That causes the MXD to be un-savable when I apply the .save() method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This seems quite bizarre to me.&amp;nbsp; Any explanations or remedies would be appreciated.&amp;nbsp; Thank you...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]30573[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 15:48:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387416#M30605</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2014-01-16T15:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387417#M30606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you please open an incident with technical support so we can evaluate the situtation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 13:11:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387417#M30606</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2014-01-17T13:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387418#M30607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd be happy to but, I have to confess, I'm not sure how to do that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you point me in the right direction, please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 20:37:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387418#M30607</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2014-01-17T20:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387419#M30608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Go to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.esri.com/en/"&gt;http://support.esri.com/en/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you have an option to contact via email or by phone.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2014 14:52:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387419#M30608</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2014-01-21T14:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387420#M30609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Incident has been created with Esri Support with the same subject/name as this forum posting.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 18:49:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387420#M30609</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-01-22T18:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387421#M30610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For reference, the incident ID is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri Incident #1234321 (Thomas J) mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Service&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 14:56:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387421#M30610</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2014-01-24T14:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387422#M30611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How about trying to use the UpdateLayer method on your ArcGIS Image Service layers?&amp;nbsp; You could pre-process the ArcGIS Image Service lyr files for your upgraded environment and then run this method using these new lyr files to replace the old layers.&amp;nbsp; This is how I accomplished something similar to you where I had to convert image layers originating in SDE with raster mosaic datasets.&amp;nbsp; I found there to be no other conversion method that would work with this type of scenario.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 15:15:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387422#M30611</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-01-24T15:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387423#M30612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your suggestion would be a good approach in a situation where we needed to update the Image Service layer sources.&amp;nbsp; In this situation, however, I only need to update the SDE connections to accommodate the upgraded SDE environment.&amp;nbsp; The Image Service environment is not changing, so there is no need or desire to update Image Server layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To illustrate this issue further, the 3 attached images document the step-by-step results at crucial points in the replaceWorkspaces() process using the ArcMap Python interactive window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;The first image is from just after the layers have been interrogated for their workspacePath and a TOC refresh.&amp;nbsp; No signs of any trouble yet.&amp;nbsp; All is well.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The second image is from just 2 commands later�?�the replaceWorkspaces() and the TOC refresh commands.&amp;nbsp; Here, the targeted SDE workspace has indeed been replaced successfully, but the replaceWorkspaces() method has also caused the non-target Image Sever Source properties to be deleted or corrupted.&amp;nbsp; Clearly, something in the replaceWorkspaces() method has stepped on the Image Server content even though replaceWorkspaces() did not pertain to any Image Service layers.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The third image follows mapDoc.save(), and illustrates that the broken doc cannot be saved.&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;SPAN&gt;The bottom line is that replaceWorkspaces() successfully updates the intended target SDE connections, but it also has the unintended consequence of deleting or corrupting non-target Image Service source properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I've missed your point, please reply back...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Jan 2014 16:46:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387423#M30612</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2014-01-26T16:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387424#M30613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Carl:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems as though you might have encountered a bug with the replaceWorkspaces() method and I would not be confident in a timely fix of a bug.&amp;nbsp; The replaceWorkspaces() method seems like a more universal resourcing method where all the data originates in the same database.&amp;nbsp; I had to resource data from multiple databases with multiple user connections to the databases.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would suggest using the replaceDataSource method where you could interrogate each connection and then build a new connection file (.sde).&amp;nbsp; If a new .sde connection file has already been built then just use the new .sde file (This is what I did).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used the .sde file with replaceDataSource and I handled my imagery with the UpdateLayer method since I was no longer storing the imagery in SDE.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This would be a workaround to the errors you are getting with the replaceWorkspaces() method.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 11:32:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387424#M30613</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-01-27T11:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387425#M30614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, the replaceDataSource() method does seem like the only ArcPy work-around at this point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 16:39:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387425#M30614</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2014-01-27T16:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387426#M30615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For information, this issue has now been registered as a bug with this reference:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NIM098396: arcpy.mapping.replaceWorkspaces will break the data source connection to an Image Service Layer when replacing a workspace in a map document.&amp;nbsp; Occurs with SDE workspaces, file geodatabases, and shapefiles.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 17:39:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387426#M30615</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2014-01-28T17:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387427#M30616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did ESRI give an estimate on when they might be able to fix this bug?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you going to us the alternate ReplaceDataSource method to process your SDE layers?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2014 18:01:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387427#M30616</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2014-01-28T18:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Ser</title>
      <link>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387428#M30617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Micheal.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No specific time frame was given for fixing the issue, but ESRI did confirm that the bug persists through versions 10.2 and 10.2.1, and that a member of their development team has taken the issue on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although lyr.replaceDataSource() would work, I elected to use mapDoc.findAndReplaceWorkspaces() as it is faster than iterating through each TOC layer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 01:12:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/mapdoc-save-fails-after-mapdoc-replaceworkspaces/m-p/387428#M30617</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2014-01-29T01:12:57Z</dc:date>
    </item>
  </channel>
</rss>

