Unregisters a replica from an enterprise geodatabase.
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.
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.
The enterprise geodatabase that contains the replica to unregister.
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.
The updated geodatabase with the replica unregistered.
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)
- Basic: No
- Standard: Yes
- Advanced: Yes