PROBLEM

Unable to overwrite a sync-enabled hosted feature layer in ArcGIS Pro

Last Published: September 20, 2024

Description

In ArcGIS Pro, it is possible to overwrite an ArcGIS Online sync-enabled hosted feature layer and have it still be sync-enabled after the overwrite. However, there are instances when the sync-enabled hosted feature layer cannot be overwritten.

Cause

The hosted feature layer contains replicas after offline areas are created in the ArcGIS Field Maps mobile app, ArcGIS Field Maps Designer, or ArcGIS Online. This behavior is similar to the documented error, 001989: Service cannot be overwritten if Sync is enabled and replicas exist.

Solution or Workaround

Use one of the following methods to remove offline areas so that a sync-enabled hosted feature layer can be overwritten.

Remove the offline areas in the ArcGIS Field Maps Designer web app

Refer to ArcGIS Field Maps: Delete a map for instructions to delete offline areas.

Remove the offline areas in the ArcGIS Field Maps mobile app

  1. Log in to the ArcGIS Field Maps mobile app via ArcGIS Online and open the project.
  2. Navigate to the offline area, tap the Overflow menu Overflow menu icon, and tap Remove Area for the offline map areas.

Remove the offline areas using ArcGIS API for Python

Note:
Use ArcGIS Notebooks to run the Python script.
  1. Import the necessary modules.
from arcgis.gis import GIS
from arcgis.mapping import WebMap

gis = GIS('home')
  1. Replace <MAP_ITEM_ID> with the item ID of the web map that requires offline areas to be deleted.
offline_map_item_id = '<MAP_ITEM_ID>'
offline_map_item = gis.content.get(offline_map_item_id)
offline_map = WebMap(offline_map_item)
  1. Define the function to remove the offline areas of the map.
for ids in offline_map.offline_areas.list():
    print('Removing map area: ' + ids.title)
    ids.delete()

The code block below demonstrates the full script.

from arcgis.gis import GIS
from arcgis.mapping import WebMap

gis = GIS('home')

offline_map_item_id = '694b23c51eca4d7c8245b98ac13165e8'
offline_map_item = gis.content.get(offline_map_item_id)
offline_map = WebMap(offline_map_item)

for ids in offline_map.offline_areas.list():
    print('Removing map area: ' + ids.title)
    ids.delete()
  1. Select the cell with the expression and click Run Run icon.jpg on the top ribbon.

Article ID: 000031917

Software:
  • ArcGIS Online
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 3
  • ArcGIS Field Maps Android
  • ArcGIS Field Maps iOS
  • ArcGIS Pro 3 2

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options