How to sync a hosted feature layer from ArcMap?

9720
11
Jump to solution
05-13-2016 03:17 PM
MatthewBaker2
Occasional Contributor II

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!

0 Kudos
1 Solution

Accepted Solutions
BruceHarold
Esri Regular Contributor

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.

View solution in original post

0 Kudos
11 Replies
PanagiotisPapadopoulos
Esri Regular Contributor

from your ArcMap open the mxd with the data from FGDB and publish the service on your Organization account

Capture.PNG

select overwrite service on the next form

Capture1.PNG

and select the hosted service you want to overwrite

Capture2.PNG

by doing this the FGDB transferred again in order to recreate the hosted service. After then the new data will be available to AGOL.

MatthewBaker2
Occasional Contributor II

Is there any way to do this from either model builder via GP tools, or with Python?

0 Kudos
BruceHarold
Esri Regular Contributor

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.

0 Kudos
MatthewBaker2
Occasional Contributor II

Bruce, I think this will be the solution. It is slow (to truncate, especially) but it is what I need.

Thank you!

0 Kudos
BruceHarold
Esri Regular Contributor

Matthew, we'll look into truncate performance, it should be using a delete with where clause OBJECTID > 0.

0 Kudos
MatthewBaker2
Occasional Contributor II

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

0 Kudos
BruceHarold
Esri Regular Contributor

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.

0 Kudos
MatthewBaker2
Occasional Contributor II

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!

0 Kudos
BruceHarold
Esri Regular Contributor

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.

0 Kudos