ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Copy

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Makes a copy of the input data.

Usage

  • If a feature class is copied to a feature dataset, the spatial reference of the feature class and the feature dataset must match; otherwise, the tool will fail.

  • Any data dependent on the input is also copied. For example, copying a feature class or table that is part of a relationship class also copies the relationship class. The same applies to a feature class that has feature-linked annotation, domains, subtypes, and indices—all are copied along with the feature class. Copying geometric networks, network datasets, and topologies also copies the participating feature classes.

  • The Copy tool does not copy layers, since a layer is only a reference to a feature class.

  • Copying a mosaic dataset copies the mosaic dataset to the designated location; the images referenced by the mosaic dataset are not copied.

Syntax

Copy(in_data, out_data, {data_type})
ParameterExplanationData Type
in_data

The data to be copied.

Data Element
out_data

The location and name of the output data. The file name extension of the output data must match the extension of the input data. For example, if you are copying a file geodatabase, your output data element must have .gdb as a suffix.

Data Element
data_type
(Optional)

The type of the data on disk to be copied. This is only necessary when the input data is in a geodatabase and naming conflicts exist, for example, if the geodatabase contains a feature dataset and a feature class with the same name. In this case, the data type is used to clarify which dataset you want to copy.

String

Code sample

Copy example 1 (Python window)

The following Python window script demonstrates how to use the Copy function in immediate mode.

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.Copy_management("majorrds.shp", "C:/output/majorrdsCopy.shp")
Copy example 2 (stand-alone Python script)

The following Python script demonstrates how to use the Copy function in a stand-alone script.

# Name: Copy_Example2.py
# Description: Copy major roads dataset to preserve the original data

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/data"

# Set local variables
in_data =  "majorrds.shp"
out_data = "C:/output/majorrdsCopy.shp"

# Execute Copy
arcpy.Copy_management(in_data, out_data)
Copy example 3 (stand-alone Python script)

The following Python script demonstrates how to use the associated_data parameter on the Copy function.

# Name: Copy_Example3.py
# Description: Copy a feature dataset and specify associated_data

# Import system modules
import arcpy

# the input is a feature dataset containing 3 feature classes: lakes, cities, rivers
in_data =  "C:/data/proj.gdb/mexico" 
out_data = "C:/data/proj.sde/mexico"

# Rename each feature class during the copy operation using the associated_data parameter
arcpy.Copy_management(in_data, out_data, associated_data=";".join(["lakes FeatureClass mexico_lakes #",
                                                                   "cities FeatureClass mexico_cities #",
                                                                   "rivers FeatureClass mexico_rivers #"
                                                                   ]))

Environments

  • Current Workspace
  • Output CONFIG Keyword
  • Scratch Workspace
  • Maintain Attachments

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics

  • An overview of the General toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal