Skip to content
Install

Protect a database

A backup you have never restored is a backup you cannot trust, and a database deleted by mistake takes its data with it. The protection settings guard against both: they block accidental deletion, take a restore point before destructive SQL, and test your backups every week.

SettingCLI flagWhat it doesNeeds backup storage
Deletion protection--deletionOrchard refuses to delete the database until you turn this off.No
Checkpoint before drops--ddl-checkpointsOrchard takes a restore point before any DROP TABLE, DROP SCHEMA, or DROP COLUMN runs.Yes
Weekly restore tests--restore-testsOrchard restores the latest backup into a temporary copy each week and checks the result.Yes
  • Edit access to the project: the Admin or Member project role.
  • A dedicated database.
  • For Checkpoint before drops and Weekly restore tests, backup storage for the organization or the instance.
  1. Open the database.
  2. Go to Settings > Protection.
  3. Turn each setting on or off. Orchard saves each change immediately.

If you try to delete a protected database, Orchard returns this error:

<name> has deletion protection on. Turn it off in its settings first.

To delete the database, turn off Deletion protection first.

After you turn these on, you can recover from a dropped table with a checkpoint, and a failed weekly test sends a notification.