Summary
Unregisters a replica from an enterprise geodatabase.
Usage
This tool must be executed as the replica owner or the geodatabase administrator. For service-based replicas, the replica owner is the database user on which the service processes were run.
If the replica has a version associated with it, this tool does not delete the version.
Make sure you no longer need to use the replica before running this tool. Once the replica is unregistered, it can no longer be used to synchronize changes.
This tool supports replicas created through ArcGIS Desktop or ArcGIS Pro using geodatabase replication or created through a feature service.
Replica names and IDs can be obtained using the Manage Replicas pane or from the feature services replicas REST resource.
If the feature service from which a replica was created is not accessible or no longer exists, you can use the arcpy.da.ListReplicas Python function to get a list of all types of replicas created in the geodatabase.
Syntax
UnregisterReplica(in_geodatabase, in_replica)
Parameter | Explanation | Data Type |
in_geodatabase | The enterprise geodatabase that contains the replica to unregister. | Workspace |
in_replica | The name or id of the replica that will be unregistered. If providing the replica name, it must be fully qualified, for example, myuser.myreplica. | String |
Derived Output
Name | Explanation | Data Type |
updated_geodatabase | The updated geodatabase with the replica unregistered. | Workspace |
Code sample
Unregister a replica by id.
import arcpy
arcpy.UnregisterReplica_management("C:\\MyProject\\myConnection.sde",
"B6F7CAB6-B9E1-4B97-A67C-1499FF59CB7D")
Unregister all replicas in a geodatabase.
# Import modules
import arcpy
# Set local variables
sdeConnection = "C:\\MyProject\\myConnection.sde"
# Loop through all replicas and unregister each one
replicas = arcpy.da.ListReplicas(sdeConnection, True)
for replica in replicas:
arcpy.UnregisterReplica_management(sdeConnection, replica.name)
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes