<?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 Error in replaceWorkspaces in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/error-in-replaceworkspaces/m-p/434625#M14645</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using ArcGIS 10.2.1 on Windows 7 64 bits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got an unexpected error when running this code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
inmxd = r'C:\GIS\mymxd.mxd'
infolder = r'C:\GIS\shapefiles'
outgdb = r'C:\GIS\myGDB.gdb'
mxd = arcpy.mapping.MapDocument(inmxd)
mxd.replaceWorkspaces(infolder,'NONE',outgdb,'FILEGDB_WORKSPACE')&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Runtime error &lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\utils.py", line 181, in fn_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return fn(*args, **kw)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\_mapping.py", line 915, in replaceWorkspaces&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return convertArcObjectToPythonObject(self._arc_object.replaceWorkspaces(*gp_fixargs((old_workspace_path, old_workspace_type, new_workspace_path, new_workspace_type, validate), True)))&lt;/P&gt;&lt;P&gt;ValueError: MapDocObject: Unexpected error&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use "SHAPEFILE_WORKSPACE" instead of "NONE" in replaceWorkspaces, then it works. But I want to be able to redirect both rasters and shapefiles from a folder to a file geodatabase. According to the documentation, "NONE" is the option to use when multiple workspaces need to be redirected. &lt;/P&gt;&lt;P&gt;I have tried the code in both the Python window or in a script and I get the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea please?&lt;/P&gt;&lt;P&gt;Joseph&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 19:28:48 GMT</pubDate>
    <dc:creator>JosephBarraud</dc:creator>
    <dc:date>2021-12-11T19:28:48Z</dc:date>
    <item>
      <title>Error in replaceWorkspaces</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/error-in-replaceworkspaces/m-p/434625#M14645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using ArcGIS 10.2.1 on Windows 7 64 bits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got an unexpected error when running this code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
inmxd = r'C:\GIS\mymxd.mxd'
infolder = r'C:\GIS\shapefiles'
outgdb = r'C:\GIS\myGDB.gdb'
mxd = arcpy.mapping.MapDocument(inmxd)
mxd.replaceWorkspaces(infolder,'NONE',outgdb,'FILEGDB_WORKSPACE')&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Runtime error &lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\utils.py", line 181, in fn_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return fn(*args, **kw)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\_mapping.py", line 915, in replaceWorkspaces&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return convertArcObjectToPythonObject(self._arc_object.replaceWorkspaces(*gp_fixargs((old_workspace_path, old_workspace_type, new_workspace_path, new_workspace_type, validate), True)))&lt;/P&gt;&lt;P&gt;ValueError: MapDocObject: Unexpected error&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use "SHAPEFILE_WORKSPACE" instead of "NONE" in replaceWorkspaces, then it works. But I want to be able to redirect both rasters and shapefiles from a folder to a file geodatabase. According to the documentation, "NONE" is the option to use when multiple workspaces need to be redirected. &lt;/P&gt;&lt;P&gt;I have tried the code in both the Python window or in a script and I get the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea please?&lt;/P&gt;&lt;P&gt;Joseph&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:28:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/error-in-replaceworkspaces/m-p/434625#M14645</guid>
      <dc:creator>JosephBarraud</dc:creator>
      <dc:date>2021-12-11T19:28:48Z</dc:date>
    </item>
  </channel>
</rss>

