AnsweredAssumed Answered

why is arcpy.CreateReplica_management taking forever to run?

Question asked by rblash on Jun 9, 2016
Latest reply on Jun 9, 2016 by rblash

I'm a bit new to python, but I decided to script out a workflow that I complete often (create checkout replicas). This is my first try at it, based on the sample script in CreateReplica_management help.

 

I ran the script via PythonWin to test but I've cancelled it after > 1 hour run time. This would take <1 minute if I ran through the wizard in ArcMap. Any ideas/pointers?

 

# Description: Create a checkout to a file GDB

# Import system modules
import arcpy
from arcpy import env

#get list of versions that will be checked out
version_list = "RLB"

#specify the checkout number for version & GDB naming
checkout_number = 1

#specify folder ocation and file name for checkout
working_folder = "D:\RLB\Python\CheckoutScript"
working_file = "TestCO_%s_v%s.gdb" % (version_list, checkout_number)

# Set workspace
env.workspace = "D:\RLB\Python\CheckoutScript\Water_D1_version%s.sde" % (version_list)

# Set local variables
in_data = ["Water_Network", "Water_Features"] # feature datasets
replica_type = "CHECK_OUT"
output_workspace = "%s\%s" % (working_folder, working_file)
replica_name = "MyReplica_%s_v%s" % (version_list, checkout_number)
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"

#create the empty GDB for checkout
arcpy.CreateFileGDB_management(working_folder, working_file)

# Execute CreateReplica
arcpy.CreateReplica_management(in_data, replica_type, output_workspace, replica_name, access_type, \
initial_sender, expand, reuse_schema, get_related, replica_geometry, archiving)

Outcomes