# Protect a database > Turn on deletion protection, automatic checkpoints before drops, and weekly restore tests for an Orchard managed database. Source: https://docs.orchard.hackclub.com/data/protection/ 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. | Setting | CLI flag | What it does | Needs backup storage | | --------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------- | | **Deletion protection** | `--deletion` | Orchard refuses to delete the database until you turn this off. | No | | **Checkpoint before drops** | `--ddl-checkpoints` | Orchard takes a [restore point](/data/backups/#take-a-checkpoint) before any `DROP TABLE`, `DROP SCHEMA`, or `DROP COLUMN` runs. | Yes | | **Weekly restore tests** | `--restore-tests` | Orchard restores the latest backup into a temporary copy each week and checks the result. | Yes | ## Prerequisites - Edit access to the project: the Admin or Member [project role](/teams/organizations/#project-roles). - A dedicated database. - For **Checkpoint before drops** and **Weekly restore tests**, [backup storage](/data/backups/#prerequisites) for the organization or the instance. ## Change the protection settings **Dashboard** 1. Open the database. 2. Go to **Settings** > **Protection**. 3. Turn each setting on or off. Orchard saves each change immediately. **CLI** Each flag accepts `on` or `off`: ```sh orchard db protect --deletion on --ddl-checkpoints on --restore-tests on ``` ## Delete a protected database If you try to delete a protected database, Orchard returns this error: ```txt 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](/run/notifications/). ## Related resources - [Back up and restore a database](/data/backups/) - Restore from a checkpoint, a backup, or a point in time. - [`orchard db protect` reference](/reference/cli/#db) - Review the protection flags.