Deleting Content and Services - merkator-software/GaiaBuilder-manual GitHub Wiki
Deleting Content
Deleting content manually from the Portal is possible, but will leave some residual traces of the old content in the GaiaBuilder Item Registry. Change the "action" parameter in de configuration JSON to "deleteContent" instead of "deployContent" to remove all the items defined in the content project. Commit this change to the JSON configuration to your GIT repository once more and run the Jobs or Pipelines when using GaiaBuilder Advanced Build server scripts or run the Upload Content Workflow from the GaiaBuilder ArcGIS Pro Add-In against your target Portal. This will delete all the items which from the configuration JSON and remove the references from the GaiaBuilder Item Registry.
When using ArcGIS Enterprise 10.8.1 or higher, deleting content can be undone by setting the "action" parameter to "deployContent" and to deploy the content again, GaiaBuilder will then deploy the content using the ItemIds from the configuration JSON. For ArcGIS Enterprise 10.8 or lower, the content can be published again, but with new ItemID's
Deleting Services on Portal for ArcGIS
Deleting Mapservices, FeatureServices or other services manually from the Portal is possible, but will leave some residual traces of the old services in the GaiaBuilder Item Registry. Change the "action" parameter in de configuration JSON to "deleteService" instead of "publishSD" to remove the Service, service extensions and layers and tables registered by GaiaBuilder and references to these items from the GaiaBuilder Item Registry. Commit this change to the JSON configuration to your GIT repository once more and run the Jobs or Pipelines against your target Portal. This will delete all the services, services extensions and layers and tables registered by GaiaBuilder and remove the references from the GaiaBuilder Item Registry.
When using ArcGIS Enterprise 10.8.1 or higher and GaiaBuilder 2.6.0 or 3.1 or higher, deleting services can be undone while maintaining the original ItemId by setting the "action" parameter to "publishSD" and if necessary configuring the "sourceitemid" property with the desired ItemID and to deploy the service again. For ArcGIS Enterprise 10.8 or lower and or GaiaBuilder 2.5.1 or 3.0 or higher the service can be published again, but Portal will generate a new ItemID
Automatically deleting registered layers from portal
When you remove a layer in a Mapservice and registerMapserviceLayers, registerMapserviceTables, registerFeatureserviceLayers or registerFeatureserviceTables with "true" has been used in a previous build and deleteObsoleteRegisteredLayersTables has been set to "true", GaiaBuilder will remove any registered layer from your portal and the GaiaBuilder Item Registry, which was removed from the mapservice. GaiaBuilder will issue a warning when deleteObsoleteRegisteredLayersTables is not set or "false" and a removed layer still exists as a registered layer.
Deleting Services on standalone ArcGIS Servers
When using a standalone ArcGIS Server run the InstallMapservice or InstallGeoprocessor script on the commandline with the "-d" parameter set to true and all other boolean parameters set to false. This will delete the service from ArcGIS Server.