Roll back and delete recovery

  • Release version: Zurich
  • Updated July 31, 2025
  • 3 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Roll back and delete recovery

    Roll back and delete recovery features in ServiceNow allow customers to undo certain actions such as patch upgrades, plugin activations, background script executions, and recover deleted records along with related changes. These capabilities are available depending on the database type used by the instance:

    Show full answer Show less
    • MySQL and MariaDB: Support both roll back and delete recovery.
    • Oracle: Supports roll back only.
    • SQL Server: Does not support roll back or delete recovery.

    Key Modules and Their Uses

    • Deleted Records module: Recovers deleted records from audited tables within seven days of deletion, including cascaded deletes. Accessible via System Definition > Deleted Records.
    • Delete Recovery module: Recovers any deleted record and all related changes within seven days. Accessible via Rollback & Recovery > Delete Recovery.
    • Script Execution History module: Enables rollback of scripts executed via the Scripts - Background module, retaining a seven-day history. Accessible via Rollback & Recovery > Script Execution History.
    • Rollback Contexts module: Manages rollback contexts for patch upgrades and plugin activations that support rollback. Rollback contexts include deleted records, patch updates, script executions, database actions, and plugin activations. Accessible via Rollback & Recovery > Rollback Contexts.

    Rollback Contexts Details

    Rollback contexts are created automatically in these scenarios:

    • When records are deleted using GlideRecord.delete() or GlideRecord.deleteMultiple().
    • During patch upgrades within a family.
    • When activating plugins that support rollback contexts.
    • When executing scripts via Scripts-Background with rollback enabled.

    Rollbacks should generally be performed on pre-production instances to restore functionality before root cause analysis. Rollback contexts expire after 10 days by default to manage data size, but this can be extended via system properties. It is important to consult Customer Service and Support before rolling back, as rollbacks delete data and may remove evidence needed for debugging.

    Rollback contexts are not created if schema changes occur during the operation, such as dropping tables or columns, truncating tables, renaming tables or columns, re-parenting columns, or changing column types or widths.

    Rollback Process on Now Support

    • The rollback updates the reported WAR version to the rolled-back version but leaves the assigned WAR version as before rollback.
    • Sets the system property glide.war.noupgrade to the pre-rollback version, preventing upgrade scripts from running.
    • Changes the state to Expired and purges stored rollback data.

    Practical Usage for ServiceNow Customers

    • Use the Rollback Contexts module to undo recent patch upgrades or plugin activations.
    • Use the Deleted Records module to recover deleted records from audited tables within seven days.
    • Use the Delete Recovery module to recover any deleted record and related changes within seven days.
    • Use the Script Execution History module to roll back database changes caused by background scripts executed in the last seven days.

    Ensure the necessary plugins are activated: Restore Deleted Records (com.snc.undelete) and Delete Recovery (com.glide.deleterecovery) to enable rollback contexts.

    Configuration

    ServiceNow provides system properties to adjust the expiration period of rollback contexts, allowing customers to retain rollback data beyond the default 10-day period when needed.

    With rollback contexts, you can roll back certain actions such as a patch upgrade, plugin activation, and background script executions, and you can recover record deletions and all related changes.

    The roll back and delete recovery features are available on instances that use MySQL and MariaDB databases. Instances that use Oracle databases only support roll back. Instances that use SQL Server do not support roll back or delete recovery.
    Table 1. Roll back and delete recovery database support
    Database type Roll back Delete recovery
    MySQL yes yes
    MariaDB yes yes
    Oracle yes no

    Deleted Records module

    This module works on records in audited tables. Recovery of cascaded deleted records must be done within seven days of the record deletion. After seven days, only data records and references on tables that audit deletions can be recovered, which is the same functionality as prior releases.

    To find this module, navigate to System Definition > Deleted Records.

    Delete Recovery module

    This module works for any deleted record. This recovery must be done within seven days of the record deletion.

    To find this module, navigate to Rollback & Recovery > Delete Recovery.

    Script Execution History module

    This module works on scripts executed using the Scripts - Background module. This history only includes seven days of script executions.

    To find this module, navigate to Rollback & Recovery > Script Execution History.

    Rollback contexts

    Rollback contexts contain everything necessary to roll back a software upgrade or plugin activation. They include deleted records, patch updates, Scripts-Background script executions, database actions, and plugin activations. A rollback context is created for each patch upgrade within a family, and each plugin activation, provided that the plugin supports rollback contexts.

    To use rollback contexts, activate the Restore Deleted Records (com.snc.undelete) and Delete Recovery (com.glide.delete_recovery) plugins.

    Rollbacks are typically performed on pre-production instances where functionality must be restored before you can find the root cause of a problem in the upgrade. Rolling back deletes data, which can often make it hard if not impossible to discover the problem that made the rollback necessary.

    A rollback context is created when:
    • GlideRecord.delete() or GlideRecord.deleteMultiple() delete records.
    • There is a patch upgrade.
    • You activate a plugin that supports rollback contexts.
    • A script executes using the Scripts-Background module, and rollback was enabled by selecting the Record for Rollback? check box.

    Rollbacks do not impact other database activities. If a database activity modifies a record that is part of a rollback context, the rollback does not affect that record.

    Because rollback contexts contain a significant amount of data, rollback contexts are deleted after 10 days. Therefore, rollbacks must occur within 10 days of the latest upgrade or plugin activation. If you need to retain a rollback context for more than 10 days, you can do so by adding a system property. See Rollback context properties.

    Note:
    Do not roll back a rollback context until checking with Customer Service and Support. A roll back deletes data and may remove evidence of the upgrade or activation issue preventing debugging of the problem.

    To find this module, navigate to Rollback & Recovery > Rollback Contexts.

    If any of the following operations occur during a rollback, a rollback context is not created:

    • Tables or columns are dropped from the schema.
      Note:
      Index drops are okay.
    • A table is truncated.
    • A table or column is renamed.
    • A column is re-parented or promoted.
    • A column type changes.
    • A column width is decreased.
    The rollback process on Now Support does the following:
    • Updates the reported WAR to the rolled-back version and the assigned WAR remains set to the version before the rollback.
    • Sets the property glide.war.no_upgrade on the instance is set to the version before the rollback.
    • Displays the message, "Desired war matches reverted war specified by property [glide.war.no_upgrade]. Upgrade script will NOT run".
    • Changes the state to Expired and the rollback purges all stored data.