Create Version (Data Management)

Summary

Creates a new version in a specified geodatabase or feature service.

Usage

  • The output version name is prefixed by the username, for example, USER1.Maintenance.

  • A version's permission can only be changed by its owner (the user who created it).

  • This tool supports creating versions for branch versioned datasets when the Input Workspace parameter value is a feature service with the version management capability enabled.

  • License:

    When working with branch versioning in an ArcGIS Enterprise 11.3 or later deployment, organization members must be assigned a license for the ArcGIS Advanced Editing user type extension to use this tool.

Parameters

LabelExplanationData Type
Input Workspace

The enterprise geodatabase that contains the parent version and will contain the new version.

For branch versioning, use a feature service URL (for example, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer).

Workspace
Parent Version

The geodatabase, or version of a geodatabase, on which the new version will be based.

String
Version Name

The name of the version that will be created.

String
Access Permission
(Optional)

Specifies the permission access level for the version to protect it from being edited or viewed by users other than the owner.

  • Private (owner only)Only the owner or the geodatabase administrator can view and modify the version or versioned data. This is the default.
  • Public (any user)Any user can view the version. Any user who has been granted read/write (update, insert, and delete) permissions on datasets can modify datasets in the version.
  • Protected (only the owner can edit)Any user can view the version, but only the owner or the geodatabase administrator can edit the version or datasets in the version.
String
Version Description
(Optional)

The description of the version that will be created. The description cannot exceed 64 characters.

String

Derived Output

LabelExplanationData Type
Updated Input Workspace

The updated input workspace.

Workspace

arcpy.management.CreateVersion(in_workspace, parent_version, version_name, {access_permission}, {version_description})
NameExplanationData Type
in_workspace

The enterprise geodatabase that contains the parent version and will contain the new version.

For branch versioning, use a feature service URL (for example, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer).

Workspace
parent_version

The geodatabase, or version of a geodatabase, on which the new version will be based.

String
version_name

The name of the version that will be created.

String
access_permission
(Optional)

Specifies the permission access level for the version to protect it from being edited or viewed by users other than the owner.

  • PRIVATEOnly the owner or the geodatabase administrator can view and modify the version or versioned data. This is the default.
  • PUBLICAny user can view the version. Any user who has been granted read/write (update, insert, and delete) permissions on datasets can modify datasets in the version.
  • PROTECTEDAny user can view the version, but only the owner or the geodatabase administrator can edit the version or datasets in the version.
String
version_description
(Optional)

The description of the version that will be created. The description cannot exceed 64 characters.

String

Derived Output

NameExplanationData Type
out_workspace

The updated input workspace.

Workspace

Code sample

CreateVersion example (stand-alone script)

The following stand-alone script demonstrates how to create a new version.

# Description: Creates a new version

# Import system modules
import arcpy

# Set local variables
inWorkspace = "c:/Connections/whistler@gdb.sde"
parentVersion = "dbo.DEFAULT"
versionName = "myVersion"
versionAccess = "PUBLIC"
versionDescription = "Version's description"

# Run CreateVersion
arcpy.management.CreateVersion(inWorkspace, parentVersion, versionName, versionAccess, versionDescription)

Environments

Licensing information

  • Basic: No
  • Standard: Limited
  • Advanced: Limited

Related topics