I am creating a replica using python/arcpy and the tables which are being replicated are empty, only the schema is replicated. Is it possible to replicate also all the data in the tables using arcpy?
I had issues with this in 10.3.1 and gave up trying to use python or model builder and just did it using ArcMap.
We have upgraded to 10.5.1 recently and I'm taking a look to see if this was fixed or easier in the new version. I found this in the tool help for the "Create Replica" tool. I haven't tried it yet, but it seems promising.
Create Replica (Data Management)
For tables the default filter is Schema Only; only the schema for the table will be replicated. To apply a filter to a table you must first create a table view setting desired filters. You can then use this as input into the Create Replica tool. See the Make Table View for more information. For more information on filters and replication see Preparing data for replication.
I am currently having the very same issue using model builder and ArcGIS 10.4 advanced.
The GP tool ran through and the snippet is as follows, but the table is still empty. Only with the Distributed Geodatabase toolbar did the table replica run through with complete records, based on my experience.
arcpy.CreateReplica_management(in_data="c:/Work/sqlcon/sqlwork.sde/sqlwork.DBO.ACIT", in_type="ONE_WAY_REPLICA", out_geodatabase="c:/Work/sqlcon/ser2work.sde", out_name="TabRep", access_type="FULL", initial_data_sender="PARENT_DATA_SENDER", expand_feature_classes_and_tables="ALL_ROWS", reuse_schema="DO_NOT_REUSE", get_related_data="GET_RELATED", geometry_features="", archiving="DO_NOT_USE_ARCHIVING")
Thanks!
Kipo,
Can you post your exact code snippet?
~Alex
I tried ALL_ROWS and the replicated table still remained empty. Is there any update on this issue?
I guess replicating table with records should be DEFAULT because that is normally what replication does. From the project automation point of view it is much easier if this can be done by Arcpy.
KP
Hi Asterios,
With the CreateReplica_management function, the default for the expand_feature_classes_and_tables parameter for feature classes is to replicate all features; the default for tables is to replicate the schema only. You will want to set this parameter to ALL_ROWS to replicate the table rows.
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.