Repository navigation
backups
This page is a summary for maintainers. It exists so you know what protection the database has and where to look in an emergency — it deliberately does not repeat the recovery commands, because those live with the code and would drift out of date here.
Important
The authoritative runbook is RECOVERY.md in the main repository. In an incident, go straight there.
Our production database, wordplay-prod, has three overlapping protections:
| Mechanism | What it can restore to | How far back |
|---|---|---|
| Point-in-time recovery (PITR) | any single minute | the last 7 days |
| Daily backups | one snapshot per day | the last 7 days |
| Weekly backups (Sundays) | one snapshot per week | the last 14 weeks |
Our development database, wordplay-dev, has no backups at all, on purpose. Nothing in it is irreplaceable, and if you lose it, there is no way to get it back. Don't put anything there you'd be sad to lose.
These schedules live in Google Cloud, not in firebase.json, which has no way to express them. They're codified in scripts/firestore-backups.sh.
Only maintainers with Google Cloud permissions on wordplay-prod can restore anything. Amy currently holds those permissions; the exact roles required are listed in RECOVERY.md.
You'll also need the Google Cloud CLI, a command line tool for managing Google Cloud services, since all of the recovery tooling is built on it.
Restoring is not as simple as "put the old data back", and doing it carelessly can make an incident worse. Two constraints cause most of the danger:
- Restoring never deletes. It puts old documents back and overwrites changed ones, but it cannot remove documents that were created after the snapshot.
-
Restoring works on whole collections, not single documents. Restoring a snapshot of
projectsrolls back everyone's projects, not just the one you're trying to rescue. Recovering one person's data means restoring into a separate scratch database first and then copying only the affected documents across.
RECOVERY.md walks through this as a decision tree, scenario by scenario. Read it before touching production.
Do you find something confusing on this page? Submit a workflow issue, so we can improve it! Every contribution counts.