Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

createReplica will not return records for a table #346

Closed dougbrowning closed 7 years ago

dougbrowning commented 7 years ago

When using fs.createReplica it will not download records for any table. It creates the table in the gdb but it is empty.

Any ideas? Layer 9 is a table

result = fs.createReplica(replicaName=HFSname, layers=[9], dataFormat='filegdb', out_path=outDir, wait=False)

Thanks

MikeMillerGIS commented 7 years ago

Does it work with a layer and a table? If so, best option is to contact tech support to see if doing just a table is supported.

dougbrowning commented 7 years ago

Originally did all the layers and tables then tried just tables. All works except 0 records in the table.

dougbrowning commented 7 years ago

Using Create Replica vis the rest web page has same result. If I do a manual download from AGO it does bring the table records down.

Bug in Create Replica?

MikeMillerGIS commented 7 years ago

There are two ways to export, take a look at the portal item replica example, it replicates the AGO download.

But yes, might be a bug in the createReplica

dougbrowning commented 7 years ago

I am trying that portal item script but can not figure out what it wants in itemId. The url? The name? Can not understand where the URL to the HFS goes.

thanks

MikeMillerGIS commented 7 years ago

the ID of the item, you can get it from the items url

dougbrowning commented 7 years ago

Yea I got it now it is the AGO page about the item not the normal /FeatureServer one like the other script uses. Thanks

I get this those. Any way to get more info on this? error on line: line 70 error in file name: with error message: Exception: Could not export item: 5a9ecdf30f53466bad14f5dbbedb1014

MikeMillerGIS commented 7 years ago

not sure, you will have to watch the traffic in fiddler and find out what is going on.

dougbrowning commented 7 years ago

Turned out to be the layers setting. I changed exportparams to None and then it brings them all down.

Thanks a lot

Now I just need to rewrite my nightly backup script to use this way. Weird that just tables do not work. Who would I even log that with support?

MikeMillerGIS commented 7 years ago

Esri tech support. You can repo without ArcRest, so it is a Feature Service Rest Create Replica issue.

tpcolson commented 7 years ago

I am not able to get a table to come across with the replica at all. It does not create the table, just replicates the feature class that is in the service. It does not replicate an attachment table as well.

MikeMillerGIS commented 7 years ago

you need to set a parameter for attachments http://resources.arcgis.com/en/help/rest/apiref/fscreatereplica.html

dougbrowning commented 7 years ago

Tom you have to list the layer numbers of the table in the layers list in the createreplica camm. So if the table is FeatureServer/9 add layers=[9] to the call.

result = fs.createReplica(replicaName=HFSname, layers=[9], dataFormat='filegdb', out_path=outDir, wait=False)

tpcolson commented 7 years ago

Yup that did it

dougbrowning commented 7 years ago

I switched to the other version and it is working great for me. Thanks a lot

dougbrowning commented 7 years ago

Mike I just found out that the ArcREST/samples/create_replica_portal_item.py script you turned me onto is leaving the Exported Geodatabases in AGO "My Content". So now our "My Content" page has hundreds of these already. Can i have it not do that or auto delete them?

It was working very well but this is a huge problem.

Thanks

MikeMillerGIS commented 7 years ago

The sample includes the delete item step, make sure that is working.

Sent from my Verizon Wireless 4G LTE DROID

dougbrowning commented 7 years ago

Now I see it hidden behind a print statement.

Thanks a lot!