While trying to import an Application from one environment to another, the existing user role assignments are getting deleted in target environment.
Is it an expected behavior?
We have multiple APEX environments including Sandbox, DEV, UAT and PROD. Each environment has different set of Application users and their role assignments. For any application upgrade (enhancement) when we are trying to export and import it to a higher environment, the existing user role assignments are getting deleted. We had to create everything from scratch. For UAT and PROD there are many more users who are continuously using the applications across the globe.
As an workaround we used to take back up of existing user role assignments, prepare script using APEX_ACL and execute after Import.
But, I don't think it's a best practice and right way to do so.
Any idea how to avoid this problem?