docs.datacontroller.io/docs/restore.md
^ fe169c00be
All checks were successful
Publish to docs.datacontroller.io / Deploy docs (push) Successful in 1m40s
fix: adding image
2024-05-02 16:36:36 +01:00

1.6 KiB

layout title description og_image
article Data Restore How to restore a previous version of a Data Controller table https://docs.datacontroller.io/img/restore.png

Data Restore

For those tables which have Audit Tracking enabled, it is possible to restore the data to an earlier state!

Simply open the submit to be reverted, and click the red REVERT button. This will generate a NEW submission, containing the necessary reversal entries. This new submission must then be approved in the usual fashion.

Note that there are some caveats to this feature:

  • It will only work for TXTEMPORAL and UPDATE Load Types
  • The user must have EDIT permission to make a submission
  • Changes made outside of Data Controller cannot be reversed
  • If there are COLUMN or ROW level security rules, the restore will abort
  • If the model has changed (new / deleted columns) the restore will abort
  • Only submissions that have actually been loaded, can be reverted (obviously)

Technical Information

The restore works by undoing all the changes listed in the MPE_AUDIT table. The keys from this table (since and including the version to be restored) are left joined to the base table (to get current values) to create a staging dataset, and then the changes applied in reverse chronological order using this macro.

Source code for the restore process is available here: https://git.datacontroller.io/dc/dc/src/branch/main/sas/sasjs/services/editors/restore.sas