Roll back and delete recovery
Summarize
Summary of Roll back and delete recovery
Roll back and delete recovery features in ServiceNow enable customers to reverse specific actions such as patch upgrades, plugin activations, background script executions, and record deletions along with related changes. These capabilities help maintain system integrity and recover from unintended changes or errors during upgrades and plugin activations.
Show less
Support for these features varies by database type:
- MySQL and MariaDB: Support both roll back and delete recovery.
- Oracle: Supports roll back only, no delete recovery.
- SQL Server: Does not support roll back or delete recovery.
Key Features
- Rollback Contexts: Capture all necessary data to roll back patch upgrades, plugin activations, and relevant script executions. Each patch upgrade and plugin activation (if supported) creates a rollback context automatically.
- Deleted Records Module: Allows recovery of deleted records from audited tables within seven days of deletion. Cascaded deletions must also be restored within this timeframe.
- Delete Recovery Module: Enables recovery of any deleted record and all associated changes within seven days of deletion.
- Script Execution History Module: Maintains a seven-day history of scripts executed via the Scripts-Background module, allowing rollback of database actions from these executions.
- Rollback Context Expiration: Rollback contexts are stored for 10 days by default; retention beyond this requires adjusting system properties.
Practical Usage and Considerations
- Rollback contexts are typically used in pre-production environments to restore system state prior to upgrades or plugin activations to facilitate troubleshooting.
- Rollback deletes data and can remove evidence needed to diagnose issues; customers should consult Customer Service and Support before performing rollbacks.
- Rollback contexts are not created if schema changes such as dropping or renaming tables/columns occur during the upgrade or activation.
- The rollback process updates instance version properties and marks the rollback as expired once completed.
- To enable rollback context functionality, customers must activate the Restore Deleted Records (com.snc.undelete) and Delete Recovery (com.glide.deleterecovery) plugins.
Navigation and Modules
- Access Rollback Contexts via Rollback & Recovery > Rollback Contexts to manage rollbacks of patch upgrades and plugin activations.
- Use Deleted Records from System Definition > Deleted Records to recover audited deleted records.
- Use Delete Recovery from Rollback & Recovery > Delete Recovery for broader deleted record recovery.
- Use Script Execution History from Rollback & Recovery > Script Execution History to review and roll back background script executions.
Summary of Benefits
These features empower ServiceNow customers to:
- Safely revert upgrades and plugin activations to maintain system stability.
- Recover critical deleted records and cascaded deletions promptly.
- Undo changes made by background scripts within a limited timeframe.
- Customize rollback context retention to fit operational needs.
Overall, roll back and delete recovery improve change management resilience and data integrity in ServiceNow environments using supported databases.
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.
| 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 .
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 .
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 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.
- 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.
To find this module, navigate to .
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.
- 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.