A little secret to rock your YouTube subscribers
Get Free YouTube Subscribers, Views and Likes

ArcGIS OnLine - Copying/Duplicating/Cloning Items

Follow
GIS Coordinated

Video 171
In this video I demonstrate how to copy feature services. It is a bit longer than usual because I demonstrate 2 different ways to perform this copy action: 1) with default buttons in AGOL and 2) with a notebook

The Notebook option can of course be scheduled as a task so if you want to use this method for backup purposes, you could schedule it to run every week for example.
A proper backup policy would be needed though in terms of naming conventions e.g. name=feature service+backup_date and also the retention policy e.g. keep backups for no longer than 12 months (storage=credits don't forget!!)

The notebook method is also good for promoting your apps through environments.

Here is the basic code I use:

myExisting_item = gis.content.get("item_id here")
cloned_item = gis.content.clone_items(items=[myExisting_item],folder="BackupFolder")
cloned_feature_layer_item = cloned_item[0]
print("New item id:" + cloned_feature_layer_item.id)
cloned_feature_layer_item.update(item_properties = {"description":"Just a copy of an existing layer",
"title":"My new title",
"tags":"environment"
})
print("All done!")

Here is the link for the python to give you a lot more info as my video is just to get you started.
https://developers.arcgis.com/python/...

posted by moseskc72tt