I am attempting to use the Production Mapping Data Load tool to copy data from one database into another with a differing schema. Something I've done manually several times, but would prefer to script it out to save some time. Unfortunately I've run into some issues, and was hoping someone may point me in the right direction.
Code Sample:
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">if</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>CheckExtension<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Foundation"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">==</SPAN> <SPAN class="string token">"Available"</SPAN><SPAN class="punctuation token">:</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CheckOutExtension<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Foundation"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">raise</SPAN> LicenseError
arcpy<SPAN class="punctuation token">.</SPAN>LoadData_production<SPAN class="punctuation token">(</SPAN>crossReference<SPAN class="punctuation token">,</SPAN> sourceDatabase<SPAN class="punctuation token">,</SPAN>
targetDatabase<SPAN class="punctuation token">,</SPAN> logRowErrs<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">except</SPAN> LicenseError<SPAN class="punctuation token">:</SPAN>
<SPAN class="string token">"Production Mapping License unavailable"</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>Returns:
AttributeError: 'module' object has no attribute 'LoadData_production'
It is worth mentioning this is the result when I execute the code from a *.py - when I copy and paste the code into an ArcMap Python window it runs fine.
I would appreciate any guidance!
V/R,
Forbes