I have ArcGIS project (.mxd) with group structure like shown below with some feature layers inside (which are stored in file geodatabase). What I need is to copy group structure from "old_layers" to "new_layers" and clone feature layers preserving group structure they were before.
Structure before transformation:
Structure after transformation (layers which are in "new_layers" group should be "new", cloned based on layers from "old_layers" group:
What I achieved so far is cloning layers giving them different suffix (arcpy.Copy_management method) Then I created new .lyr file which is a copy of "old_feature" layers so the structure of groups is preserved, then I can add new (cloned) feature layers to the .lyr file with arcpy.mapping.AddLayerToGroup method, some loops and if conditions but the last step (removing old feature layers from .lyr - arcpy.mapping.RemoveLayer) - doesnt work, so I have old and new feature layers in the same structure.
I hope you get my point.