899 views

Restoring a deleted role and related tables




Overview

Deleting an important role can have a big impact on an instance. In this case, restoring the instance from backup is not the solution. Follow the steps below to restore a deleted role and its related tables, therefore helping regain the previous order. 

 

Procedure

Some manual fixes may be needed after restoring the deleted records but the restoration of specific tables will help get users, groups, applications, and modules working as expected again. The following steps use the itil role as an example of the deleted role.


Step 1:  Locate the deleted record and restore it.

To located and restore the deleted record:

    1. Navigate to System Definition > Deleted Records.

    1. Filter the list using Tablename | is | sys_user_role. Alternatively, add the following extension to the instance URL:  /sys_audit_delete_list.do?sysparm_query=GOTOtablename%3dsys_user_role.

  1. If the record is not available to restore, you can export and import the role in XML format from another instance. For additional information, refer to Export List Data
    Note: The sys_id of the role should match with the tables that are being copied from the other instance.

 

Step 2:  Export related tables from a sub-production instance where the role relationships are intact.

    1. Right-click the list header and select Export > XML to pull specific lists of the records that are needed.

  1. Export the data from the most recent copy of the affected instance. The list below indicates the main tables that should be copied over, note that we are filtering the lists to only include the records that are related to the role that is being restored.

    sys_user_has role
    ( user roles table where users had the itil role )
    [ e.g.  /sys_user_has_role_list.do?sysparm_query=role%3Daf9af44ae0400100b22b979b3b4ec7ac&sysparm_view= ]

    sys_app_module
    ( module records that had the itil role )
    [ e.g.  /sys_app_module_list.do?sysparm_query=roles%3Ditil&sysparm_view= ]

    sys_app_application
    ( application records that had the itil role )
    [ e.g.  /sys_app_application_list.do?sysparm_query=active%3Dtrue%5Edevice_type!%3Dmobile%5Eroles%3Ditil&sysparm_view= ]

    sys_group_has_role
    ( group roles table that had the itil role )
    [ e.g.  /sys_group_has_role_list.do?sysparm_query=role%3Daf9af44ae0400100b22b979b3b4ec7ac&sysparm_view= ]

    sys_user_role_contains
    ( roles that had the itil role )
    [ e.g.  /sys_user_role_contains_list.do?sysparm_query=contains%3Daf9af44ae0400100b22b979b3b4ec7ac&sysparm_view= ]

     

Step 3:  Import related tables to the affected instance.

    1. Navigate to any list on the target instance.

  1. Right-click the column header in the list and select Import > XML.

Step 4:  Review the results and manually fix any remaining items.

Article Information

Last Updated:2016-11-09 12:57:31
Published:2013-03-26