Use System clone

The System clone application automates much of the cloning process. Specific tasks are performed during the clone request process.

An administrator defines what data is preserved on the target instance and what data from the source is not cloned, then initiates the clone process. A background job ensures that all cloning requirements are met and carries out the clone process. These processes and procedures are performed on the source instance.

During a clone, the target instance may be intermittently unavailable. After clone completion, you have up to 24 hours to contact ServiceNow Customer Support and request a rollback of the target instance to its pre-clone state. You are notified when the rollback is complete.

Clone request process

In response to a clone request, the ServiceNow platform performs the following tasks.
  1. Generates a file to preserve operational data on the target server.

    This file contains the data preserved by data preservers.

  2. Copies the database schema from the source instance to the target instance.
  3. Creates tables in the target instance database using the source instance table definitions.
  4. Copies data from the most recent nightly backup of the source instance to the target instance database.

    Certain large tables are normally excluded. These include audit, log, and email tables.

  5. Briefly disables UI traffic and requests to the target instance server.
  6. Displays the message Clone in progress... to any user accessing the target instance.
  7. Restores operational data preserved from the target instance.
  8. Runs any post-clone cleanup scripts on the target instance.
  9. Briefly suspends all email functions on the target instance.
  10. Queues an event to regenerate text indexes.
  11. Enables UI traffic and requests to the target instance server.

Create a clone target

You create a target instance record before the instance can be selected as clone target.

Before you begin

Role required: clone_admin or admin

About this task

Note: If you are using IP Access Controls on your instance, the target instance must allow the IP range 10.0.0.0/10.255.255.255 to communicate on a local network to allow the clone. For more information, see IP range based authentication.

Procedure

  1. Navigate to System Clone > Clone Targets.
  2. Click New.
  3. Enter the URL for the receiving instance (target).
  4. Enter the basic authentication credentials for a user account with the admin role on the target instance.
    Clone target
    Note: These credentials must exist in the User [sys_user] table as a user record or as part of an LDAP integration. Clone requests cannot use single sign-on to authenticate users from an identity provider.
  5. Click Submit.
    The system checks connectivity and validates the user credentials against the target instance.

Start a clone

For most instances, an administrator can start a clone.

Before you begin

Role required: clone_admin or admin

About this task

For instances that use an Oracle database, see KB0538884 - System Clone Support for Oracle Customers.

Procedure

  1. Navigate to System Clone > Request Clone.
  2. Select a Target instance to receive the cloned data.
  3. Complete the Options form section.
    Table 1. Clone options
    Field Description
    Clone from

    Select the source database, if more than one database is available. If only one source is available, the Clone from menu does not appear.

    By default, the clone process ignores this field and uses data from the most recent nightly backup of the source instance. The clone process only uses this field value if the clone from backup fails for some reason.

    Exclude audit and log data Select this option to prevent the cloning of tables specified in System Clone > Exclude Tables. This option is selected by default. Clearing the check box causes the platform to ignore the Exclude Tables module.
    Exclude large attachment data When selected, the clone excludes any record in the Attachment [sys_attachment] and Attachment Document [sys_attachment_doc] tables that meet these criteria.
    • The table_name value does not start with ZZ_.
    • The table_name value is not sys_certificate, ecc_agent_jar, ecc_agent_mib, or sys_store_app.
    Preserve theme Select this option to prevent the cloning of CSS elements, colors, and banner displays. This option enables or disables any data preservers where Preserve theme is True.
  4. Schedule a Date and time to perform the clone.
    Scheduling prevents multiple clones from occurring on the same target instance concurrently. A clone must be scheduled at minimum four hours in advance.
  5. Enter an Email address to receive alerts after the clone finishes, is canceled, or has an error.
    Clone start
  6. Click Submit.
  7. In the authentication window that appears, enter the Username and Password for an administrator account on the target instance.
  8. Click Authenticate.
  9. Review the clone settings and click OK.
    An email is sent to the supplied address after the clone finishes, is canceled, or has an error.
    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.

Post-clone cleanup scripts

The Cleanup Scripts module allows you to define scripts to automatically run on the target instance after a clone is finished.

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. The following post-clone cleanup scripts perform various actions on the target instance.

Table 2. Post-clone cleanup scripts
Script Description
Disable emails Disables email on the target instance. A default data preserver maintains other email settings from the target instance.
Regenerate text indexes Rebuilds text indexes on the target instance after a clone. Text indexes are not cloned from the source to the target instance.
Clear scheduled job node association Resets any scheduled jobs that were active on the source instance to the Ready state. This script also clears the value of the System ID and Claimed by fields on all scheduled jobs.
Install deactivated plugin Enables the Domain Separation plugin for instances that use this feature.
Drop backup tables Schedules the deletion of the data contained in the target instance database prior to the clone. This original data is preserved for 24 hours following a clone to allow 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.

Work with clones

You can add a system property to allow an instance to be cloned, cancel a clone, and send clone status notifications.

Allow a clone

Production instances cannot be used as the target instance for a clone after the instance is live. Also, the glide property glide.db.clone.allow_clone_target must be set to True to allow an instance to be a clone target. Attempting to clone over an instance where this property is False displays the following error:

Figure 1. Clone target invalid
Clone target error message

This property is False by default, and to True on instances where the name ends in Dev, Test, Stage, UAT, or QA.

To modify the value of this property, add the property to the [sys_properties] table.

Cancel a clone

ou can cancel a clone without negatively impacting system stability or usability. Canceling a clone restores the target instance to the pre-clone state, retaining all original data.

To cancel a scheduled or in-progress clone, navigate to System Clone > Clone History. Select the clone and click Cancel Clone.

Send clone status notifications

You can configure the instance to send notifications regarding an active clone. These notifications indicate when the clone finishes, is canceled, or has an error. Use the Email upon completion field to specify who to send status notifications to. Users specified as the primary or secondary support contacts for your company also receive these notifications.

Clone to an instance on a different version

The System Clone application can target an instance running a different ServiceNow version from the source.

A central web service controls clone processing and automatically modifies the target instance version to match the source instance version. This matching process starts up to eight hours before the time specified in the Date and time field on the System Clone form. This web service also ensures that there is enough disk space on the target instance for the clone to proceed.

When cloning from a backup, the target instance does not need additional time to upgrade or downgrade. The ServiceNow platform performs any version changes during a brief window where the target instance is unavailable, after it copies data from the source instance backup.

View clone history and active clones

You can view clone history information. All previously and currently scheduled clones from a particular instance display on this table. The clone history module additionally lists clones that have begun but have not yet finished.

About this task

Role required: clone_admin or admin

Procedure

Navigate to System Clone > Clone History.
Clone history also displays the State for current and past clones. Clones in the draft state do not appear on the clone history table.
Clone completed
Table 3. Clone state
Clone state Description
Requested The clone was requested and is awaiting approval.
Scheduled The clone is ready to begin at the scheduled time and date.
Active The clone is currently running.
Completed The clone completed successfully.
Canceled A user canceled the request.
Hold The server rejected the clone request. This can happen either because the clone was not ready to proceed by the scheduled time or because additional clone requests were submitted before the first one completed.
Error The clone encountered an error while running. Contact technical support for help resolving this issue.
Figure 2. Active system clone
Active clone log

After starting a clone, the Clone Log and Database Table Clones related lists appear on the form. These related lists show general log messages, and the details of individual tables respectively.

The duration of time a clone remains active varies depending on the amount of data being cloned, and whether the source and target instance are in the same physical location. If a clone takes longer than anticipated, ServiceNow Technical Support can identify additional details about the clone progress.