How to preserve data during cloning in lower environments.

deepum
Giga Guru

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!! 

7 REPLIES 7

Anshu_Anand_
Kilo Sage
Kilo Sage

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

find_real_file.png

Article everything need to know about cloning :-

https://community.servicenow.com/community?id=community_article&sys_id=c770ae21db50c114fd8d2b6913961...

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0715621

 

cloning best practices:-

 

If its helpful,please mark answer as correct

Regards,
Anshu

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!

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

Regards,
Anshu

@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)