Copy (Data Management) |
|
Release 9.2
Last modified November 29, 2010 |
![]() ![]() ![]() Print all topics in : "Tools" |
Copies input data from one location and pastes it to another location. You can copy entire feature datasets or individual feature classes and tables.
Usage tips
The Copy tool copies data from one location and name to a new location and name.
The input and the output of Copy will be the same data type. Therefore, if the input type is a shapefile, the output type will also be shapefile. Be sure the output workspace supports the output data type. For example, do not try to copy a shapefile into a geodatabase.
A data element does not include layers. Therefore, it will not copy layers in the ArcMap Table of Contents or layers created in ArcCatalog. The tool will copy layer files (.lyr). To copy a layer in the ArcMap Table of Contents with a geoprocessing tool, use the Make Feature Layer tool.
When using the Copy tool, any data dependent on the input data element is also copied. For example when copying a feature class or table that is a part of a relationship class, the relationship class, along with the feature class or table to which it relates, is also copied. The same is true for a feature class that has feature-linked annotation, the feature-linked annotation is also copied. When present, domains, subtypes and indexes will be copied along with a feature class.
When copying to an ArcSDE geodatabase, it is possible specify a configuration keyword to control how the new feature classes and tables are stored.
To copy a geometric network or a topology class and all the participating feature classes, copy and paste the network or topology class only. This will copy all participating feature classes as well.
If a feature class is copied to an existing feature dataset, the spatial reference of the feature class and the feature dataset must match. If the spatial references do not match the data will not be copied.
The following environment settings affect this tool: Extent, workspace and scratch workspace.
Command line syntax
An overview of the Command Line window
Copy_management <in_data> <out_data> {data_type}
Parameter | Explanation | Data Type |
<in_data> |
The input data element to be copied to the new location. |
Data Element |
<out_data> |
The name of the new output data element to be created. |
Data Element |
{data_type} |
This is the type of data being copied. In the case where a geodatabase contains a feature dataset and a feature class with the same name, you may want to specify the type of data to be copied. You would need to specify feature dataset or feature class. |
String |
Copy_management D:\Workspace\Newfoundland.mdb\Landuse\roads D:\StudyArea.mdb\roads
Scripting syntax
About getting started with writing geoprocessing scripts
Copy_management (in_data, out_data, data_type)
Parameter | Explanation | Data Type |
in_data (Required) |
The input data element to be copied to the new location. |
Data Element |
out_data (Required) |
The name of the new output data element to be created. |
Data Element |
data_type (Optional) |
This is the type of data being copied. In the case where a geodatabase contains a feature dataset and a feature class with the same name, you may want to specify the type of data to be copied. You would need to specify feature dataset or feature class. |
String |
# Create Geoprocessing Object import arcgisscripting gp = arcgisscripting.create() # Set the input workspace gp.workspace = "D:/Workspace/NFTest.mdb" # Loop through each feature class to make a backup fcs = gp.listfeatureclasses("*") fc = fcs.Next() try: # Create backup Geodatabase gp.CreatePersonalGDB_management("D:/Workspace", "NFBackup.mdb") while fc: gp.copy_management(fc, "D:/Workspace/NFBackup.mdb/" + fc) fc = fcs.Next() except: print gp.getmessages(2)