4411 views

Description

Unexpected result after clone in tables User [ sys_user ] and Group[ sys_user_group] , Contacts [ customer_contact ] related tables.

Please refer to Inconsistent Data in tables User [ sys_user ] and Group[ sys_user_group] , Contacts [ customer_contact ] related tables after Instance Clone, which is performed before 1st May 2020 for more information. 

Release or Environment

Release/Environment: NewYork, Orlando

Cause

After 7th Feb 2020 & Before 1st May 2020 the "Preserve users and related tables" functionality was enabled. When submitting Clone request by default "Preserve users and related tables" will be checked, as a result, this will Exclude and Preserve 'User' related tables data in the target instance.

The following tables are affected:

  • sys_user
  • sys_user_group
  • sys_user_grmember
  • sys_user_role
  • sys_user_has_role
  • customer_contact

Afterward, we experienced PRB1351704 - The clone functionality "Preserve users and related tables" does not work as expected and is now disabled for all clones. The decision was made to disable the feature until it is fixed.

After 1st May 2020: We disabled the "Preserve users and related tables" functionality. [Even if this "Preserve users and related tables" checked OR NOT, this will not Exclude and Preserve User related data in target instance].

Our sincere apologies for the quick changes in the cloning process, we will be adding this information in Clone Change Requests too

Resolution:

The next question is what is the best way to Exclude and Preserve Users n related tables now?

PLEASE NOTE: All preserve and exclude settings are taken from the SOURCE instance used by the clone. Ensure these settings are set on the SOURCE, not the target instance.

Please create the following Excludes:

  • sys_user
  • sys_user_role
  • sys_user_has_role
  • sys_user_group
  • sys_user_grmember
  • sys_group_has_role
  • sys_user_role_contains
  • customer_contact [Only if you have the Customer Service Management plugin installed]

This will not bring over any users from the source instance or any of the references to groups and roles, but now you need to preserve the sys_user , but something that many people forget is you also need to preserve roles, groups and also the links from users to roles and groups, this is a common mistake and after cloning you are missing the admin role and cannot log in, this is because the links to the roles are missing.

Now you should create these Preservers: (Add any conditions depending on your requirements)

  • sys_user
  • sys_user_role
  • sys_user_group
  • sys_user_grmember
  • sys_user_has_role
  • sys_group_has_role
  • sys_user_role_contains
  • customer_contact [Only if you have the Customer Service Management plugin installed]

This will preserve all the users, roles, and groups in the target instance, but it will also preserve the permissions of those users to those groups and roles.

This is documented in the following article for creating a preserver

https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/managing-data/concept/data-preservation.html#t_CreateADataPreserver

Additional Information

Request a Clone

Article Information

Last Updated:2020-11-20 14:29:29
Published:2020-11-20