Apologies for the long winded explanation below but I'd be grateful for some suggestions to get round a problem with a solution that contains the out of the box User entity.
The solution in question has a bunch of custom entities as well as some out of the box ones. Unfortunately in the case of the User entity it was included with 'All Assets' ticked. Whenever it is exported this results in a whole list of warnings about missing Microsoft components. It has worked up until now as those missing components have existed in all instances from Dev through to Production.
However, this week that changed and the solution won't install anywhere as it's missing a whole bunch of Omnichannel components required by the User entity across about 3 Microsoft solutions and these don't appear to be in any other instance, so I'm guessing something has been installed in the Dev environment that is not present in any other.
To avoid this sort of pain I thought it would make sense to remove the User entity from the main solution and only put back the main form and one new custom field as that is all that has been changed (custom entities with 'All Assets' I've seen will automatically have their relationships added back to User. I did this in a spare instance and exported and all the export warnings magically disappeared. However, as a precaution I thought I'd check the User entity to see if it had any unmanaged components. This was fresh in my memory as we've recently had a 3rd party do a similar exercise to the contact and account entities where they changed their unmanaged solutions from 'All Assets' to just their own customised components. When they pushed it to production it ended up deleting a couple of Microsoft Marketing segmentid lookups and associated relationships so they ended up having to take those two fields and relationships from another instance and put them back to production via an unmanaged solution.
When I checked the User entity in Production all looked good until I clicked on the 1:N section. There are over 5,000 relationship where at least 70% of them are marked as unmanaged! To my mind that means I can't possibly release the streamlined main solution as can't take the risk of deleting these relationships! The behaviour I had observed before where Microsoft entities have unmanaged components is that if you include them in your own managed solution then the Active layer in the target instance gets removed and replaced with the managed layer of your solution. If you then change the entity in your solution from 'All Assets' and just include the things you've changed then importing that back into the target instance results in the Microsoft component being deleted since it only has a managed layer tied to your own solution.
Clearly this would be a disaster with thousands of relationships being unmanaged so the only thought I've had is to potentially create a redundant solution just to hold the 'unmanaged' components of the User entity and then push that into the target so that they now become 'managed' and tied to the redundant solution. At that point I'm assuming it would be safe to remove User from the main solution and put back individual components so that when importing main solution into target instance it will simply remove the main solution layer from Microsoft's formerly unmanaged relationships and just leave the redundant solution layer. I really don't like this workaround though and what issues it might introduce when Microsoft make any changes to the relationships impacted.
Our service desk will be raising a Microsoft Support ticket to discuss the above and what can be done but I'd be interested to hear any ideas you might have.