I have created a script for cloning hosted feature services from one portal to another using the clone_items method. The script works as expected with smaller feature services. However when using large feature services, I get this error:
('Failed to create Feature Service MyService: list index out of range', <Item title:"MyService" type:Feature Layer Collection owner:portaladmin>)
It seems as if there is a limit on how large a feature service that can be cloned. I did some experiments with a feature class with app. 1100 polygons. I limited the number features with a definition query in the map, shared it with Portal A and cloned to Portal B. Repeating this process, increasing the number of features, I started getting the error at app. 900 features. But I don't know if it is the actual number or (more likely) a certain size that triggers the error.
I can't find anything in the documentation.
Does any know of a size limitation of clone_items or have I missed something?
I had a quick look and I couldn't find anything regarding the item cloning size limits either.
You can contact the ArcGIS API for Python support to find out:
https://support.esri.com/en/Products/Developers/scripting-and-automation/arcgis-api-for-python/
Thanks! I already contacted support yesterday, and they are investigating the issue.
I just heard from Esri Support. There is already logged a bug on the issue.
Bug Number: BUG-000122287
Unfortunately the bug has status "Closed" and "Not in production plan" and the advice is to use workarounds as exporting or duplicating the schema and appending.
I checked the log. It's recommending a workaround which reducing the number of vertices in features using Generalize tool in ArcGIS Pro. This is quite helpful when you don't have a lot of feature classes already published.