---
name: backup-and-rollback-readiness
description: Use when asked whether a website or web app could recover from a bad deploy, a hacked site, a deleted database, or a lost hosting account; before a migration or cutover; or when writing a rollback runbook. Inventories what must be backed up (code, content, database, media, config, DNS, secrets location), checks that backups exist and restore, and documents one-step rollback. Read-only by default; restores happen only on a non-production copy.
---

# Backup and rollback readiness

Last reviewed: 2026-11-10

## Quick prompts

For anyone improving a site or app, whether a small-business owner or someone at a larger company practicing better prompts. A backup only counts once a restore has worked, and knowing the undo steps turns a bad update into a short, planned fix. Paste a prompt into any AI assistant that can see the site or repo.

1. "For the site or app I work on, list what would need backing up (code, content, database, images, settings) and where each copy lives today. Point out anything with only one copy. Report only."
   *Why this prompt works:* Asking for single points of failure focuses on real risk.

2. "If a bad update went live on the site I work on today, what are the exact steps to undo it, and how long would it take? Write it as a simple checklist; don't change anything."
   *Why this prompt works:* Ask for a checklist format so the answer is usable under pressure.

3. "Review our plan to move the site I work on to a new host: [paste]. Is there a clear way back if it goes wrong? List gaps in plain language, and don't change anything."
   *Why this prompt works:* Pasting the plan lets the assistant critique the real thing.

A backup is only real once a restore has worked. A rollback is only real once someone has written down the steps and timed them.

## Hard limits

- Read-only on production. Test restores only into a scratch or staging environment, never over production.
- Never copy secrets, database dumps, or backups into chat, tickets, or repos. Record where they live and who can reach them, not their contents.
- On shared or inode-limited hosting, do not create archives or temp files on the server without approval.
- DNS, registrar, and hosting account changes need the owner's explicit approval. Deliverable is a report and a runbook, plus optional review PR for automation.

## Inputs to gather

1. Hosting, CDN, DNS host, registrar, email host, and who holds each login (owner, agency, nobody known).
2. Where content lives: Git (static/markdown), CMS database, headless CMS, object storage for media.
3. Deploy method and whether the host keeps deployment history with instant rollback.
4. Recovery goals: how much data the owner can lose (RPO) and how long the site can be down (RTO).

## Interface-type notes

- **Static / Git-based sites**: code and content are in Git; check media and large files outside Git, build env vars documented by name, and the host's "rollback to previous deployment".
- **CMS sites**: database + uploads + plugins/themes; nightly off-host backups; version pinning of plugins.
- **E-commerce / SaaS**: database point-in-time recovery, order/payment data consistency, migrations that are reversible or have a forward-fix plan, feature flags for risky releases.
- **SPAs + APIs**: front end and API versions compatible both ways during rollback.

## Steps

1. **Inventory**: list every asset and where its copy lives: repo, database, media, config/env var names, DNS zone export, TLS (usually auto), email settings, third-party accounts. Mark single points of failure (one person's login, one copy).
2. **Check backups**: frequency, retention, off-site/off-account copy, encryption, and last successful run date.
3. **Test restore** (with approval): restore the latest backup into staging; confirm it builds or boots, page counts and record counts match, media loads.
4. **Rollback paths**: for each change type (code deploy, content publish, dependency update, config/header change, DNS change), write the exact rollback steps and expected time. Note what cannot be rolled back (sent emails, DNS caches, search engine re-crawls).
5. **Cutover plan** (if migrating): keep the old host running until the new one is verified; lower DNS TTL a day ahead; have a written back-out trigger and steps.

## Validation

- Restore test results with timings, compared against RPO/RTO.
- A dry run of the code rollback on a preview (for example redeploying the previous build) with timing.

## Report format

1. Asset inventory table: asset, primary location, backup location, frequency, last verified restore, owner of access.
2. Gaps ranked by risk.
3. Rollback runbook per change type (numbered steps, time, who).
4. Recommendations needing approval (backup service, DNS export, second admin).

## References

- NIST SP 800-34 Rev. 1 Contingency Planning Guide: https://csrc.nist.gov/pubs/sp/800/34/r1/upd1/final
- CISA #StopRansomware Guide (offline, tested backups): https://www.cisa.gov/stopransomware/ransomware-guide
- Google SRE book, release engineering and rollbacks: https://sre.google/sre-book/release-engineering/
- Cloudflare Pages rollbacks (example of host-level rollback): https://developers.cloudflare.com/pages/configuration/rollbacks/
- Netlify and Vercel have equivalent "instant rollback" docs; use the host's own.
