<?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 Copy GP Tool used in Python in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/copy-gp-tool-used-in-python/m-p/406088#M13749</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use the Copy GP tool in desktop and in a Python script to copy feature datasets, but cannot get it to work either way.&amp;nbsp; Very frustrating!&amp;nbsp; What's the quirk here?&amp;nbsp; If I select a feature dataset in a file GDB in catalog and click copy, and then past it into another file gdb, all works fine.&amp;nbsp; This is what I want to do.&amp;nbsp; But, I need to script this process, thus need to use the GP tool Copy.&amp;nbsp; I'm trying umpteen things, just not getting there at all.&amp;nbsp; It might work once, but then to repeat it is impossible.&amp;nbsp; Is there a better way to do?&amp;nbsp; Any help would be greatly appreciated!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;v10 sp3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy, os

inFDS = "C:\\Temp\\testing.gdb\\sunday"
outFDS = "C:\\Temp\\testing_copied2.gdb\\sunday"

# Declare workspaces
inWorkspace = os.path.dirname(inFDS)
outWorkspace = os.path.dirname(outFDS)

arcpy.env.workspace = inWorkspace
&amp;nbsp;&amp;nbsp; 
arcpy.Copy_management(inFDS, outFDS, "FeatureDataset")

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;error messages are not helpful, maybe this one, but...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"While using the Copy tool, the input could not be successfully copied to its new location. This error typically occurs while copying data from one location to another.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "in_memory" workspace is not supported as the output location."&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Feb 2012 18:50:24 GMT</pubDate>
    <dc:creator>MikeDriver</dc:creator>
    <dc:date>2012-02-20T18:50:24Z</dc:date>
    <item>
      <title>Copy GP Tool used in Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/copy-gp-tool-used-in-python/m-p/406088#M13749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use the Copy GP tool in desktop and in a Python script to copy feature datasets, but cannot get it to work either way.&amp;nbsp; Very frustrating!&amp;nbsp; What's the quirk here?&amp;nbsp; If I select a feature dataset in a file GDB in catalog and click copy, and then past it into another file gdb, all works fine.&amp;nbsp; This is what I want to do.&amp;nbsp; But, I need to script this process, thus need to use the GP tool Copy.&amp;nbsp; I'm trying umpteen things, just not getting there at all.&amp;nbsp; It might work once, but then to repeat it is impossible.&amp;nbsp; Is there a better way to do?&amp;nbsp; Any help would be greatly appreciated!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;v10 sp3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy, os

inFDS = "C:\\Temp\\testing.gdb\\sunday"
outFDS = "C:\\Temp\\testing_copied2.gdb\\sunday"

# Declare workspaces
inWorkspace = os.path.dirname(inFDS)
outWorkspace = os.path.dirname(outFDS)

arcpy.env.workspace = inWorkspace
&amp;nbsp;&amp;nbsp; 
arcpy.Copy_management(inFDS, outFDS, "FeatureDataset")

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;error messages are not helpful, maybe this one, but...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"While using the Copy tool, the input could not be successfully copied to its new location. This error typically occurs while copying data from one location to another.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "in_memory" workspace is not supported as the output location."&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2012 18:50:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/copy-gp-tool-used-in-python/m-p/406088#M13749</guid>
      <dc:creator>MikeDriver</dc:creator>
      <dc:date>2012-02-20T18:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Copy GP Tool used in Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/copy-gp-tool-used-in-python/m-p/406089#M13750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried this code (note I do not set a workspace) and it copied the featuredataset and the featureclasses within it without error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

import arcpy
i = r'C:\Scratch\fGDB_Scratch.gdb\test' 
o = r'C:\Scratch\fGDB_AIS_Cleaned.gdb\test'
arcpy.Copy_management(i,o,"FeatureDataset")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:28:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/copy-gp-tool-used-in-python/m-p/406089#M13750</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-11T18:28:11Z</dc:date>
    </item>
  </channel>
</rss>

