I'm trying to set up a process to keep hosted feature layers in sync from a FGDB.
I've been going through various documentation, such as this article:
Manage hosted web layers—ArcGIS Online Help | ArcGIS
...but it leaves me at:
It was published from a client other than the ArcGIS Online website. If you published the hosted feature layer from ArcMap, overwrite the service from ArcMap.
So how do you overwrite the service from ArcMap?
I'd like to make the service name remains the same, as it will be in use from a javascript application.
So far I can use the 'upload service definition' tool in ArcGIS Desktop, but I don't see anywhere an option to sync or update the data in a service from an ArcMap tool.
Thanks!
Solved! Go to Solution.
Yes, but it would be a coding challenge.
I have been using Data Interoperability extension in ArcGIS Pro 1.2 to read and write feature services.
This release has good support for feature services, and you can use the ChangeDetector (for example) to create a delta set of features to overwrite, without any downtime or bulk overwrite, treating your FGDB as the master database.
The fme_db_operation format parameter can be used to control INSERT/UPDATE/DELETE behavior if you have a mixture, or the writer settings.
from your ArcMap open the mxd with the data from FGDB and publish the service on your Organization account
select overwrite service on the next form
and select the hosted service you want to overwrite
by doing this the FGDB transferred again in order to recreate the hosted service. After then the new data will be available to AGOL.
Is there any way to do this from either model builder via GP tools, or with Python?
Yes, but it would be a coding challenge.
I have been using Data Interoperability extension in ArcGIS Pro 1.2 to read and write feature services.
This release has good support for feature services, and you can use the ChangeDetector (for example) to create a delta set of features to overwrite, without any downtime or bulk overwrite, treating your FGDB as the master database.
The fme_db_operation format parameter can be used to control INSERT/UPDATE/DELETE behavior if you have a mixture, or the writer settings.
Bruce, I think this will be the solution. It is slow (to truncate, especially) but it is what I need.
Thank you!
Matthew, we'll look into truncate performance, it should be using a delete with where clause OBJECTID > 0.
Thanks, Bruce! I'd be happy to provide feedback as I build this processes.
I'll be pulling from SQL Server Spatial views and writing them to the staging FGDB before truncating and loading with FME... will be using point and polygon data for this.
-m
Hi
If you're making a FGDB (with Data Interop or FME) it can be a zipfile that is output and if you upload/replace that as a portal item and publish it with overwrite.
I started down the path of this with a Pro script tool (attached) but we'll look into supporting it without coding in Data Interop/FME.
One thing that's happening is the service I'm trying to publish constantly hangs when uploading it for the first time on the 'Server-side post processing' in ArcCatalog, and the 'Creating Service' spinning icon on AGOL...
The data is <30mb...
Oh scratch that - it just finished... took almost an hour though!
That is why I publish from an uploaded FGDB item for large datasets. I have published services with millions of features that way; publishing from a map has failed for me on occasion. The asynchronous nature of publication also isn't a good fit inside a desktop application - for big data. I have waited overnight for some to publish, but they always succeeded.