Backups
D1 + KV snapshots. Daily 30d, weekly 1y, monthly forever (R2 lifecycle on the bucket itself — configure once via wrangler r2 bucket lifecycle).
Non-JSON response (200)
| Key | When | Size | Metadata |
|---|---|---|---|
| No backups in this tier yet. | |||
Restore — manual procedure
Restore is a deliberate human action; no auto-button by design.
- Download a backup:
npx wrangler r2 object get loft-mission-control/<key> --pipe > backup.json - Apply migrations to target DB (or new throwaway DB for drill):
for f in apps/admin-api/migrations/*.sql; do npx wrangler d1 execute <db> --remote --file=$f; done - Restore: use
scripts/restore-d1.mjs(TODO Plan 3.15 Task 4) or hand-roll an INSERT loop from the JSON. Verify row counts match the backup header before declaring done. - Document the drill outcome in
.kb/work/mission-control/15-backup-restore-drills/YYYY-MM.md.