Hello @shildebrand,
I understand the concerns you have but as the item is moving from one ArcGIS Enterprise to another ArcGIS Enterprise, the new Web App will need the items from the Development to Production, they would most definitely change.
However, I have another approach which you can try and check if it works for you. I have used ArcGIS API for Python in past to make this and similar this work, kindly find the sample below:
- Install Required Libraries: Make sure you have the ArcGIS Python API installed. e.g. pip install arcgis
- Import required modules:
- from arcgis.gis import GIS
- Authenticate to the development
- Authenticate to the Production
- Clone Web Map and Services: Clone the web map and services from the development to the production environment.
- Clone the web map from development to production
- web_map_item = dev_gis.content.get("web_map_item_id")
- web_map_item.clone(copy_data=True, folder="Production")
- Clone the Web App Configuration: To ensure widget configurations are maintained, clone the Web AppBuilder application's configuration.
- service_item = dev_gis.content.get("service_item_id")
- service_item.clone(copy_data=True, folder="Production")
- Find the Web AppBuilder application in your development environment
- web_app_item = dev_gis.content.get("web_appbuilder_app_item_id")
- prod_web_app_item = web_app_item.clone(
folder="Production",
copy_data=True,
search_existing_items=True
)
- Update References in the Production Configuration: Since we've cloned the Web AppBuilder application with its original configuration, We will need to update references to the web map and services that we cloned earlier. In our production configuration, find the references to the development environment's items and replace them with the new item IDs generated during the cloning process.
- Update web map references in the cloned app configuration
- app_config = prod_web_app_item.get_data()
- app_config['values']['webmap'] = "<new_web_map_id>"
- Update service references in the cloned app configuration. Iterate through the widgets and update the relevant widget configurations
- for widget in app_config['widgets']:
if 'itemId' in widget:
widget['itemId'] = "<new_service_item_id>"
- Update and save the modified configuration
- prod_web_app_item.update(data=app_config)
Once you do the above steps the new Web Application should be present in Production with reference to production Web Map and Service configuration. I would recommend that after updating the web app's configuration, thoroughly test it in the production environment to ensure that everything is working as expected. Be sure to verify that widget configurations have been correctly transferred.
Furthermore, you can also use https://ago-assistant.esri.com/ to compare the JSON of the Development item and Production item to make sure no reference are there from Development
Additionally, If your application uses custom URLs, ensure that DNS and URL references are updated to point to the production environment.
This preserves the widget configurations while migrating your Web AppBuilder application, web map, and services to the production environment.
Hope it helps!
-Archit