How to preserve data during cloning in lower environments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2022 08:52 AM
Hello all,
I have users in Lower environments who have roles only in lower environments, which we use for testing purposes. During the clone, the PROD data is being cloned and the users are losing their roles and being replicated as in PROD. is there a way to preserve the data (a few roles) in lower instances so that we don't need to provide the users the roles in lower environments? I know that I can keep XML of the data but are there any other best practices?
Any help appreciated.
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2022 08:59 AM
use preservers on sys_user_has_role and sys_user_grmember, since by 2 ways generally we give roles to user .give condition for roles or users you want on group member table
Article everything need to know about cloning :-
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0715621
cloning best practices:-
If its helpful,please mark answer as correct
Anshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2022 11:34 AM
thank you for the response @anshu
so do I need to just provide the names of the users on the sys_user_has_role table.
does that only preserve the users in provide and delete the remaining users in the table?
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2022 09:58 PM
Yes in the target instance the data will be preserved the user roles are filtered in condition
as per the scenario #3
- Table Exclusion: None
- Data Preserver: Yes, plus 'Conditions' field contains a value.
Results #3
- Records in sys_temp table on target, found by Data Preserver, are preserved.
- Records in sys_temp table on target, not found by Data Preserver, are deleted.
- Records in sys_temp table on source, which do not exist in sys_temp table on target (based on sys_id), are copied to sys_temp table on target.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0717012
Please mark answer as correct, if its helpful
Anshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2022 05:25 PM
@anshu I took the same scenario as an example, but here in my case, I don't want the other user records to be deleted. I have almost 8K users in PROD but only for 100 users in lower environments I have added these roles(for testing purposes)