ArcGIS-Desktop Replication Error – How to Fix Fail to Create Replica in ArcGIS-10.6 with Error 000582

arcgis-10.6arcgis-desktoparcmaperror-000582replication

I'm trying to create a one-way replica between two ArcGIS Enterprise Geodatabases. The process works when I select only the tables in the parent. The replica will successfully copy all datasets to the child database. However, when I select the feature classes (there are hundreds of them), the process fails after about 17-18 minutes or so.

Replica Settings:

enter image description here

Error Message:

ERROR 000582: Error occurred during execution. Item with the same path
name already exists.

enter image description here

The child database is essentially empty and doesn't contain any feature classes yet. My first thought was that the process was truncating long feature class names, however, the feature class name length limit is 255 characters and the longest one (including database name and schema is 95 characters).

Both databases are on different servers. Both servers are are Windows Server 2016. Databases are SQL Server 2017.

I had a look at this site, where one suggestion is to create a replica on each individual dataset to see which one is causing the error. However, there are over 600 feature classes. Is there an easy way to figure out what is going on here?

Best Answer

Using following code, you can use identify the feature class that is causing this problem. But before using this delete/unregister previous replicas.

import arcpy
from arcpy import env

# Set workspace, must be ParentDB.
parent_workspace= "parent.sde" 
child_workspace ="child.se"
env.workspace="parent.sde"

replica_type = "ONE_WAY_REPLICA"
#make sure the replica name does not conflit with the existing name.
access_type = "FULL"
initial_sender = "PARENT_DATA_SENDER"
expand = "USE_DEFAULTS"
reuse_schema = "DO_NOT_REUSE"
get_related = "GET_RELATED"
replica_geometry = ""
archiving = "DO_NOT_USE_ARCHIVING"

# Execute CreateReplica for each feature class

fdlist = arcpy.ListFeatureClasses()
for fd in fdlist:
    in_data=fd
    replica_name=fd
    try:
        arcpy.CreateReplica_management(in_data, replica_type, child_workspace , replica_name,access_type, initial_sender, expand, reuse_schema, get_related, replica_geometry, archiving)
    except:
    #problematic feature class.
        print (fd)
Related Question