Skip To Content

Alter Version

Summary

Alters the geodatabase version's name, description, and access permissions.

Usage

  • Versioning tools only work with enterprise, workgroup, and desktop geodatabase data. File geodatabases do not support versioning.

  • Versions are not affected by changes occurring in other versions of the geodatabase.

  • A version's permission can only be changed by the version owner.

  • This tool supports altering branch versions through the version service.

Syntax

AlterVersion_management (in_workspace, in_version, {name}, {description}, {access})
ParameterExplanationData Type
in_workspace

The database connection file to the enterprise, workgroup, or desktop geodatabase where the version to be altered is located. The default is to use the workspace defined in the Current Workspace environment.

For branch versioning, use a feature service URL (that is, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer) or the feature layer portal item.

Workspace
in_version

The name of the version to be altered.

String
name
(Optional)

If you are changing the version name, enter the new name for the version.

String
description
(Optional)

If you are changing the version description, enter the new description for the version.

String
access
(Optional)

Specify the access permission you want to set for the version. The following values are supported:

  • PRIVATEOnly the owner can view the version and modify available feature classes. This is the default.
  • PUBLICAny user can view the version and modify available feature classes.
  • PROTECTEDAny user can view the version, but only the owner can modify available feature classes.
String

Code sample

AlterVersion example (stand-alone script)

The following stand-alone Python script uses the AlterVersion geoprocessing tool to alter a version.

# Description: Changes the name of a version

# Import system modules
import arcpy

# Set local variables
inWorkspace = "c:/ConnectionFiles/ninefour@gdb.sde"
versionName = "myVersion"
newName = "myVersion2"

# Execute AlterVersion
arcpy.AlterVersion_management(inWorkspace, versionName, newName, "#", "PUBLIC")

Environments

Licensing information

  • ArcGIS Desktop Basic: No
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics