ServiceNow: Using the Clone Data Preserver

In some cases, you may want to clone your ServiceNow production data to a developer instance. While there can be many reasons to do so, problems with the PagerDuty integration can occur if the data is cloned without using a Clone Data Preserver. Please use this guide to address common issues that may arise when replicating a ServiceNow environment.

What is the Clone Data Preserver?

The Clone Data Preserver is a ServiceNow feature that defines what data should not be replaced when cloning one environment into another.

Why Should I Use This?

When you clone your environment, you also clone the PagerDuty integration. When this happens you will lose PagerDuty configuration in the target destination, such as Configuration Item and assignment group mappings, service IDs, and API keys. To clone the PagerDuty integration in a way that it remains functional, you can use the Clone Data Preserver to preserve specified PagerDuty fields.

The steps below outline how to use Clone Data Preservers so that information in an example production environment will appear in a developer instance.

📘

Required Permissions

In order to use the Clone Data Preserver feature, your ServiceNow role must include clone_admin or admin.

Create Clone Data Preservers

There are two ways to create Clone Data Preservers:

Create Clone Data Preservers by Importing an Update Set

As an alternative to creating the Clone Data Preservers manually, you can import an update set on the source ServiceNow instance. In keeping with our prod to dev example, you would import the appropriate update set onto your prod instance before cloning to your new dev instance.

This update set will work for the v5 and v6 versions of the PagerDuty integration. Note that this update set only preserves the PagerDuty Settings configuration. To preserve the mappings for users, assignment groups and Configuration Items, a ServiceNow administrator can follow the instructions to manually preserve those records.

Create Clone Data Preservers Manually

Following this process, you will make Clone Data Preservers for the four following tables:

  1. System Property Table
  2. User Table
  3. Group Table
  4. Configuration Item Table

Each step will prompt you to enter a name for the Clone Data Preserver. We recommend entering a descriptive name for your own reference later, for example “PagerDuty for New Dev Env” or “Preserve User Mappings”.

System Property Table

To begin, we'll address PagerDuty fields in the System Property table (sys_properties).

  1. Navigate to System Clone Preserve Data, and select New.
  2. Create a new record for the Clone Data Preserver and select the table System Property [sys_properties].
  3. Create OR conditions for the following Names.
    • Name Is x_pd_integration.default_user OR
    • Name Is x_pd_integration.instance_url OR
    • Name Is x_pd_integration.sn2pd_mapping OR
    • Name Is x_pd_integration.default_service OR
    • Name Is x_pd_integration.api_key OR
    • Name Is x_pd_integration.webhook_restapi OR
    • Name Is x_pd_integration.sn_auth_user OR
    • Name Is x_pd_integration.sn_auth_userpwd
  4. Click Submit.
2162

System Property [sys_properties] Table

User Table

Next, create a Clone Data Preserver for the sys_user table.

  1. Navigate to System Clone Preserve Data, and select New.
  2. Create a new record for the Clone Data Preserver and select the table User [sys_user].
  3. Create a filter with the following condition:
    • PagerDuty ID is not empty
  4. Click Submit.
2802

User [sys_user] Table

Group Table

Thirdly, create a Clone Data Preserver for the sys_user_group table.

  1. Navigate to System Clone Preserve Data, and select New.
  2. Create a new record for the Clone Data Preserver and select the Group [sys_user_group] table.
  3. Create filters with the following conditions:
    • PagerDuty escalation is not empty OR
    • PagerDuty schedule is not empty OR
    • PagerDuty service is not empty OR
    • PagerDuty team is not empty OR
    • PagerDuty webhook is not empty OR
  4. Click Submit.
2800

Group [sys_user_group] Table

Configuration Item Table

Lastly, create a Clone Data Preserver for the cmdb_ci table.

  1. Navigate to System Clone Preserve Data, and select New.
  2. Create a new record for the Clone Data Preserver and select the Configuration Item [cmdb_ci] table.
  3. Create filters with the following conditions:
    • PagerDuty service is not empty OR
    • PagerDuty webhook is not empty
  4. Click Submit.
2806

Configuration Item [cmdb_ci] Table

Note: The Clone Data Preservers for user, assignment group and Configuration Item table will preserve the entire record in the target instance, not just PagerDuty ID values. Additionally, these filter conditions given in this guide are tailored for the out-of-box integration. If you’ve implemented any customizations, you may need to alter your queries for each Clone Data Preserver.