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 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

Rename

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

Summary

Changes the name of a dataset. This includes a wide variety of data types, among them feature dataset, raster, table, and shapefile.

Usage

  • The output name must be unique. If it is not, an error message is reported, even if the geoprocessing overwrite output environment is set to true.

  • This tool does not rename layers, since a layer is a reference to a dataset.

  • The Rename tool does not rename fields in the dataset. For example, if you have a field named ROADS_ID in a feature class named Roads, renaming the Roads feature class to Streets does not rename the ROADS_ID field to STREETS_ID.

  • Renaming a coverage also renames all region and route subclasses within a coverage.

  • This tool does not work with data stored in a DB2 database due to database constraints.

Syntax

arcpy.management.Rename(in_data, out_data, {data_type})
ParameterExplanationData Type
in_data

The input data to be renamed.

Data Element
out_data

The name for the output data.

Data Element
data_type
(Optional)

The type of data to be renamed. The only time you need to provide a value is when a geodatabase contains a feature dataset and a feature class with the same name. In this case, you need to select the data type (feature dataset or feature class) of the item you want to rename.

String

Code sample

Rename example 1 (Python window)

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

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.Rename_management("customers.dbf", "customers_2010.dbf")
Rename example 2 (stand-alone script)

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

# Name: Rename_Example2.py
# Description: Rename fileGDB feature class

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/workspace/test.gdb"

# Set local variables
in_data =  "test"
out_data = "testFC"
data_type = "FeatureClass"

# Execute Rename
arcpy.Rename_management(in_data, out_data, data_type)

Environments

  • Current Workspace
  • Scratch Workspace

Licensing information

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

Related topics

  • An overview of the General toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

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