When I run my py script I get an "Error: Out of Memory" at the last task arcpy.ImportXMLWorkspaceDocument_management. We're using 10.6 software by Esri. Does anyone know if it's related to how I wrote the script or possibly some other problem?
<SPAN class="comment token"># Name: EnterpriseGDB.py</SPAN>
<SPAN class="comment token"># Description: Import/Export the contents of my geodatabase to an XML workspace document.</SPAN>
<SPAN class="comment token"># Import system modules</SPAN>
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">import</SPAN> os
<SPAN class="keyword token">import</SPAN> platform
<SPAN class="keyword token">import</SPAN> imp
<SPAN class="keyword token">import</SPAN> time
xmlDocument <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"C:\EnterpriseGDB.xml"</SPAN>
<SPAN class="keyword token">if</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Exists<SPAN class="punctuation token">(</SPAN>xmlDocument<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Removing xml document"</SPAN><SPAN class="punctuation token">)</SPAN>
os<SPAN class="punctuation token">.</SPAN>remove<SPAN class="punctuation token">(</SPAN>xmlDocument<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"successful"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Set overwrite output</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>OverwriteOutput <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
<SPAN class="comment token"># Set local variables for exports</SPAN>
in_data <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"Database Connections\SDE.sde"</SPAN>
out_file <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"C:\EIS\EISMASTER\eis shape\ArcMap\EnterpriseGDB.xml"</SPAN>
export_option <SPAN class="operator token">=</SPAN> <SPAN class="string token">"DATA"</SPAN>
storage_type <SPAN class="operator token">=</SPAN> <SPAN class="string token">"BINARY"</SPAN>
export_metadata <SPAN class="operator token">=</SPAN> <SPAN class="string token">"METADATA"</SPAN>
<SPAN class="comment token"># Set local variables for imports</SPAN>
target_gdb <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"C:\EIS\EISMASTER\eis shape\ArcMap\UPDM.gdb"</SPAN>
in_file <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"C:\EIS\EISMASTER\eis shape\ArcMap\EnterpriseGDB.xml"</SPAN>
import_type <SPAN class="operator token">=</SPAN> <SPAN class="string token">"DATA"</SPAN>
config_keyword <SPAN class="operator token">=</SPAN> <SPAN class="string token">"DEFAULTS"</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Exporting SDE to XML Document"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Execute ExportXMLWorkspaceDocument</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>ExportXMLWorkspaceDocument_management<SPAN class="punctuation token">(</SPAN>in_data<SPAN class="punctuation token">,</SPAN> out_file<SPAN class="punctuation token">,</SPAN> export_option<SPAN class="punctuation token">,</SPAN> storage_type<SPAN class="punctuation token">,</SPAN> export_metadata<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Finished Exporting"</SPAN><SPAN class="punctuation token">)</SPAN>
time<SPAN class="punctuation token">.</SPAN>sleep<SPAN class="punctuation token">(</SPAN><SPAN class="number token">120</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Importing NEW XML Document to Local GDB"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token"># Execute ImportXMLWorkspaceDocument</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>ImportXMLWorkspaceDocument_management<SPAN class="punctuation token">(</SPAN>target_gdb<SPAN class="punctuation token">,</SPAN> in_file<SPAN class="punctuation token">,</SPAN> import_type<SPAN class="punctuation token">,</SPAN> config_keyword<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Finished Importing!"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>