How to preserve local user roles while cloning from another instance?

stevedag
Kilo Expert

We often clone from our Prod instance to our Dev instance so our data is updated and we're sure the DEV instance is well synchronized with our production.   However, in our DEV instance we gaved higher roles to some user to allow them to test their module.   For example, most of them have the personalization role to allow them to personify in DEV, but are allowed to personify in production.

When we clone the DEV instance from PROD, those extra roles are lost and we have to give them back after the clone process.   What's the best way to preserve those extra roles although we clone the instance?

Thank you!

Steve

1 ACCEPTED SOLUTION

Hi Dimitar!



I created a new forum for cleanup scripts after cloning.


This should help you and others!



This should all help.



Preserve data and activity post clone - Cleanup Scripts



Have fun!


View solution in original post

10 REPLIES 10

Thank you Mike


By the way, you cannot specify sys_user_has_roles as an exclusion table, as this is a critical system tables. Excluding a table results in an empty table on the target instance.


Hi Dimitar



The best and easiest solution we've found is to do an after clone script that gives back the user's rights in our sub-production instance.   It runs after the clone and cleans up the environment and adds the roles needed to perform tests.



Steve


That sounds interesting, would you mind sharing the script here, I bet it would help others as well.


Hi Dimitar!



I created a new forum for cleanup scripts after cloning.


This should help you and others!



This should all help.



Preserve data and activity post clone - Cleanup Scripts



Have fun!