I want to find number of records synchronized while using arcpy.SynchronizeChanges_management
tool. Right now, I'm getting only messages like process is Executing, Synchronize successfully completed... and Succeeded at some time.
One way I thought of get count of all feature classes in dataset before and after the tool run and then compare the both counts. In this process I can only get the newly added but not the modified record or one record is added and other existing record is deleted from feature class then too the count will be same.
# sync parameters
#Path to source sde connection file
geodatabase_1 = source_sde
in_replica = "replica_name"
#Path to target sde connection file
geodatabase_2 = target_sde
in_direction = "FROM_GEODATABASE1_TO_2"
conflict_policy = "IN_FAVOR_OF_GDB1"
conflict_defin = "BY_OBJECT"
reconcile = "DO_NOT_RECONCILE"
# call sync tool
sync_result = arcpy.SynchronizeChanges_management(geodatabase_1, in_replica,
geodatabase_2, in_direction,
conflict_policy, conflict_defin,
reconcile)
# want to print synchronized records
print sync_result
How can I find the number of records(newly added and updated) synchronized?
Answer
Export Data Change Message GP tool could be used which creates a delta file with changes to synchronize (number of records could be obtained from the result).
No comments:
Post a Comment