Possible to update Portal Item 'itemid' or 'id' with Python API?

11-06-2018 04:01 PM
New Contributor II

I know that it is possible to update the item_properties for an item as outlined here Managing your content | ArcGIS for Developers .  

I am writing a script to automate the migration of some Portal applications from dev > test > prod.  Our team has maintained the same item 'id' for the application in the past by using ArcGIS Online Assistant (you can edit the json and change the id).  That way our users can maintain a bookmark to the application in their browser (the id is part of the url).

Is it possible to edit the 'itemid' or 'id' using the Python API?  If not, is there another way to programmatically update it?

3 Replies
New Contributor III

@Benjamin Hillam

Did you figure it out, how to maintain ID of portal item?

0 Kudos
New Contributor III

I am also wondering if this is possible! 

0 Kudos
Occasional Contributor

Yes, programmatically at 10.8.1+, at least for ArcGIS Server Map/Feature services:

  1. Add the new item with the item_id you desire using the ContentManager and the (Available at 10.8.1+) item_id property.
  2. In the ArcGIS Server admin console, edit the portal properties of the referenced service to match the new item_id
  3. Republish (overwrite) the new Portal layer with service content (from ArcGIS Pro) - this might be optional but would allow you to confirm your settings
  4. Delete the 'old' item(s) from Portal
0 Kudos