Overwrite a hosted feature layer

You can replace all the data in a hosted feature layer or hosted table that you published from one of the following file types:

  • File geodatabase (zipped)
  • Shapefile (zipped)
  • GeoJSON file
  • Microsoft Excel file
  • .csv file
  • OGC GeoPackage file
  • Service definition file (.sd)

To overwrite the hosted feature layer or hosted table with the contents from an updated file, upload an updated source file. You must use the same type of source file, and the schema in the source file must be the same as when you published the hosted feature layer. If the hosted feature layer was published from a file on a cloud drive, the updated file must be on the cloud drive.

For example, if the hosted feature layer is public and you don't want it to be editable, or if another department regularly sends you data updates in a shapefile, you can overwrite the data in the hosted feature layer using the updated file. This maintains the layer's URL, the properties that you set on the Overview and Settings tabs of the hosted feature layer's item page, symbology, and pop-up configurations. However, because overwriting the hosted feature layer republishes the service and overwrites every layer in the hosted feature layer, field settings such as unique value, default values, and disallowing null values are not preserved, and you must reset them after you overwrite the hosted feature layer.

When you overwrite the data using a local source file, both the file and hosted layer data in ArcGIS Online are replaced with the data from the updated source file. If the source is a shapefile with metadata or a file geodatabase that contains feature classes and tables with metadata, ArcGIS Online adds or replaces the layer-level metadata in the hosted layer. If you published the hosted feature layer or hosted table from a cloud drive, the data stays in the cloud drive but the data in the hosted layer item is replaced.

If the option to overwrite the layer isn't available, the hosted layer cannot be overwritten from the item page due to one of the following conditions:

  • It was published from a client other than the ArcGIS Online website. For example, if you published the hosted feature layer from ArcGIS Pro, you must overwrite the service from ArcGIS Pro.
  • It was published from a .csv file before March 2014.
  • Synchronization is enabled on the hosted feature layer or hosted table.
  • It's a hosted feature layer view rather than a hosted feature layer. To update the data values in both the hosted feature layer view and hosted feature layer from which it was created, overwrite the hosted feature layer and the updates will be reflected in the view.
    Note:

    If the associated hosted feature layer view has an area of interest defined on it, you cannot overwrite the hosted feature layer from the item page.

    You cannot overwrite the source hosted feature layer if the view is a joined view.

  • You enabled data change tracking on the layer.
  • You deleted the associated source file.
  • You opened the Update data window from a sublayer page or from the Data tab of the hosted feature layer or hosted table item.
  • You're not the item owner or a member of the default administrator role.

Caution:

  • Any edits that were made to the hosted feature layer data are replaced by the data from the updated source file. If the hosted feature layer contained attribute indexes and you overwrite using source data that does not have attribute indexes, you must re-create the attribute indexes on the hosted feature layer.
  • The same fields and feature classes (in the case of file geodatabases) must be present in the updated file as were in the original file. For example, if you delete a feature class from the file geodatabase, or add a field to the shapefile or feature class, do not overwrite.
  • The file name must be the same as the original file name. If you upload a file geodatabase, the feature class names must be the same as they were in the original file you uploaded.
  • If you overwrite and the schemas and feature class names do not match, the feature layer and web maps that use the feature layer may not function as expected. If the source data schema has changed, or if you want to preserve the edits made to the data in the hosted feature layer, load the file as a new item and publish a new layer instead.
  • The data source and hosted layer must be owned by the same account. If you change the owner of one, change the owner of the other; if you do not, you can't overwrite the hosted layer.
  • Behavior and restrictions when overwriting a feature layer from ArcGIS Pro may differ from behavior in the item page. For information about overwriting a feature layer from ArcGIS Pro, see Overwrite a web feature layer in the ArcGIS Pro help.
  • If you used addresses or places to locate features when you first published the layer, overwriting the layer geocodes all the addresses or places in the updated file. This may use credits depending on how your organization is configured. Talk to your ArcGIS Online administrator if you have questions about which service is used to geocode locations in your organization. The locator selected when you initially published the layer is automatically used when overwriting.
  • If you altered the details of individual sublayers, those edits will be lost when you overwrite the hosted feature layer from a file.
  • The feature layer will be unavailable to other users for a brief time while the layer is overwritten.

To overwrite a hosted feature layer from a file, complete the following steps:

  1. Sign in to your organization.

    You must be the owner of the hosted feature layer or a member of the default administrator role.

  2. Open the item page for the hosted feature layer or hosted table.
  3. Click Update data on the item's Overview tab.
    Tip:

    You may need to click the Show more button Show more to see all options.

    The Update data window appears.

  4. Choose Overwrite entire feature layer.
  5. If the hosted feature layer or hosted table was published from a local file, click Next to specify a file on disk. Use one of the following methods to choose the file and overwrite the layer's contents:
    • Click Your device, browse to and select the file, and click Open.
    • Drag the file from your desktop or File Explorer onto the Update data window.
  6. If the hosted feature layer or hosted table was published from a file on a cloud drive, click Sign in and overwrite.

    As soon as you connect to the cloud drive, ArcGIS Online automatically overwrites the existing content with content from the source file on the cloud drive.