Hi,
Using the ArcGIS API for Python I'm trying to create a script that overwrites, or re-publishes, the contents of a hosted feature service.
Using ArcGIS Pro 3.1.1, Enterprise 11.0, and PostgreSQL 13.3
Here's my current script:
from arcgis.gis import GIS
from arcgis.features import FeatureLayer
from arcgis.features import FeatureLayerCollectiongis = GIS("https://ourservername.abc.def/portal", username="username", password="password")
postgres_fc = r"path to postgresql.sde\featureClass"
hosted_fs = gis.content.get('feature service id')
hosted_flc = FeatureLayerCollection.fromitem(hosted_fs)
hosted_flc.manager.overwrite(postgres_fc)
For the postgres_fc variable I've tried both a simple, and a fully qualified name (dbname.sde.featureName).
When executed, the script returns "success,", and the timestamp on the hosted feature service is updated,. However the data is unaffected.
Am I missing a step? Is the script completely off the mark?
Any help will be greatly apreciated!
Thanks
-Chris