Process of System Clone in Servicenow
Process of System Clone in Servicenow
• This application is used to copy everything in a database from one instance to another.
• Cloning is typically used to copy a production instance to a pre-production instance to
test changes.
• Cloning data comes from the most recent, nightly backup.
Clone Process
In response to a clone request, the ServiceNow platform performs the following tasks:
Note:
Preserve means: keep what data is already there on the target instance but add to it.
Exclude means: If no preserve, don't even bring data to the target instance, but instead make it
empty. Otherwise, if preserved, but excluded, then keep what is there, but don't touch it.
Request Clone:
Create a clone target
A clone target record specifies the instance URL and credentials used for cloning.
• provide credentials for a user with the admin role. Use a local user account, not an LDAP
or SSO user account. The target instance credentials must exist in the User [sys_user]
table as a user record or as part of an LDAP integration. Clone requests cannot redirect
authentication requests to a single sign-on identity provider.
• System property on target instance: verify the system property
glide.db.clone.allow_clone_target is set to True. By default, this property is enabled on
instances whose name ends in Dev, Test, Stage, UAT, or QA.
• IP Access controls on target instance: if the target instance uses IP range based
authentication, it must allow the IP range 10.0.0.0/10.255.255.255 to communicate on a
local network.
• Role required: clone_admin or admin.
• Navigate to All -> System clone -> Clone Target.
Exclude a table from cloning
Exclude a table to create an empty but usable table on the target instance.
You can use data preservers to protect data on the target instance from being overwritten. If
you have custom applications, you must also manually preserve unpublished application
content.
Warning: You must define data preservers on the source instance. Defining them on the target
instance does not preserve the data.
Data preservers typically preserve system settings and themes, such as:
Warning: If the clone from backup fails for some reason, the clone process fails over to the
legacy clone engine. The legacy clone engine cannot preserve data from extended tables,
relationships, hierarchies between tables, and dot-walked queries. You may want to reschedule
a system clone or manually transfer data in such cases.
Navigate to System Clone > Clone Profiles to view your clone profiles.
Cancel a clone
You can cancel requested, scheduled, and active clones without negatively impacting system
stability or usability. Canceling a clone restores the target instance to the pre-clone state,
retaining all original data.
Role required: admin
Procedure
• Navigate to All > System Clone > Live Clones > Active Clones.
The system displays the list of currently active clones.
• Select the clone you want to cancel.
The system displays the System Clone record.
• From Related Links, click Cancel Clone.
The Cancel Clone modal displays.
• In Specify Reason, select a reason for the cancellation and click OK, or select Others,
enter a reason in the text box and click OK.
The system stops any current clone activities and sets the State to Canceled.
Schedule cloning
You can use System Clone to schedule automatic cloning, which is the easiest way to keep your
cloned instances up to date.
Role required: admin
Procedure
• Click System Clone > Active Clones > <one-of-your-clones>.
Note: (Optional) if the Options panel is not already displayed.
Click the Options arrowhead so it turns downward.
The Options panel appears.
Result
The instance contains the same data it had before the clone was applied.
Use cleanup scripts to modify or remove bad data. Cleanup scripts run after data preservers
and the clone is complete.
You can add new post-cloning scripts on the source instance to perform any action that can
normally be accomplished through script includes or business rules. To add a script, navigate to
System Clone > Clone Definition > Cleanup Scripts and click New.
Note: Cleanup scripts will always run on clones created using a Clone profile, this is necessary
as they're available OOB and ensure a healthy state post clone.
You can make post-clone scripts active or inactive to control whether these scripts run or do
not run. You can also set an order number on each script, which enables you to set the order
that the active scripts run, with lower numbers having a higher priority.
The following post-clone cleanup scripts perform various actions on the target instance.
Post-clone cleanup scripts
Script Description
Runs a script include called
BadMIDCredentialAfterClone on a cloned
instance to detect bad MID Server user
credentials. This script include creates
Bad MID Server credentials after clone
scheduled jobs that log MID Servers in the
Down state to the MID Server Issue
[ecc_agent_issue] table after an instance
clone.
Resets any scheduled jobs that were active
on the source instance to the Ready state.
Clear scheduled job node association This script also clears the value of the System
ID and Claimed by fields on all scheduled
jobs.
Migrates email accounts that existed on the
Configure Email Accounts source instance to the target instance if they
are not enabled there. This script also
migrates the email properties to the target
instance.
Disables email on the target instance. A
Disable emails default data preserver maintains other email
settings from the target instance.
Enables the Domain Separation plugin for
Install deactivated plugin
instances that use this feature.
Rebuilds text indexes on the target instance
Regenerate all text indexes after a clone. Text indexes are not cloned
from the source to the target instance.
Schedules the deletion of the data that is
contained in the target instance database
prior to the clone. This original data is
preserved for 24 hours following a clone to
Schedule drop backup tables
enable you to roll back an instance to the
pre-clone state. If the target instance is
downgraded as part of the clone, backup
data is not available.