I'm working on an arcpy script that removes a feature class and then recreates it. The feature class is part of a replica, and I need to recreate the replica as part of the script, however you cannot unregister a replica using arcpy.
If I manually remove the replica using Distributed Geodatabase > Manage Replicas > Unregister, the script works fine recreating the feature class and the replica, however if I don't manually remove it first the script fails:
Message: ERROR 000775: Replica with the same name already exists.
Failed to execute (CreateReplica).
I have found my replica in SQL using:
SELECT *
FROM [GDB_ITEMS]
WHERE Type = '4ED4A58E-621F-4043-95ED-850FBA45FCBC'
AND Name = 'MyReplicaName'
Can I "safely" remove this entry in GDB_ITEMS
to unregister my replica? If so, I could probably use arcpy to send the SQL to remove it just so I can continue with my script.
By "safely" I mean it's just a single reference and I don't need to remove it from 10 other tables as well to unregister the replica.
If it's relevant, the replica is two-way full SDE to SDE database replica.