Skip to content
Dee Wan 1.0 is not yet released (pre-MVP). See the 1.0 product boundary.

Standalone recovery runbook

How to recover a standalone website’s data and media with your provider’s own tools. Dee Wan has no backup service. Nothing on this page has been run against a live deployment by this project. Rehearse it on a disposable copy before you rely on it.

The Wrangler commands below are Cloudflare’s. They are checked against Cloudflare’s D1 and R2 Wrangler command references, D1 import and export guide and D1 Time Travel reference on 2026-09-23. This repository runs only wrangler d1 export itself (scripts/d1.ts).

Part Where it lives Recovered by
Code Your repository Git. A commit identifies it.
Generated content rows Generated tables in your D1 database Reloading the committed snapshot (npm run data:load), or a database restore
Your own rows Your own tables in the same D1 database A database restore only
Media Your R2 bucket, if you moved media into your custody Your own copy of the objects
Secrets Your repository secrets and Worker secrets Your secret store. Never in a backup file.

A code rollback in Settings restores none of the rows or media above.

First pause processes that write data: your own jobs and CMS deployments to this site.

Export the database to a file:

Terminal window
npx wrangler d1 export <database-name> --remote --output backup-<date>.sql

An export blocks other requests to the database while it runs, and Cloudflare does not export databases that contain virtual tables. Numeric values pass through JavaScript numbers, so integers beyond 52 bits of precision can change.

Record the repository commit that was deployed, the export time and a checksum of the file. For media, copy every object key listed in data/media-manifest.json out of your bucket, for example with npx wrangler r2 object get <bucket>/<key> --remote --file <path>. Keep the copies outside the bucket.

Create a new database and load the export into it:

Terminal window
npx wrangler d1 create <restore-database-name>
npx wrangler d1 execute <restore-database-name> --remote --file backup-<date>.sql

The generated deployment resolves its own database from its configuration, and this project has no command that targets a restored copy. Point a separate, non-production Worker configuration at the restored database yourself, deploy the recorded commit to it, then verify it with API_BEARER_TOKEN in the environment:

Terminal window
npm run verify:deployment -- --origin 'https://restore.example.com' --expect-commit <full-commit-sha>
npm run verify:media

verify:deployment compares the deployed content with the committed snapshot. verify:media checks media references in the committed projections. It does not download bytes. Open representative pages and media yourself.

Cloudflare D1 Time Travel restores a database in place to an earlier point in time. It reaches up to 30 days back on the Workers Paid plan and 7 days on the Workers Free plan. --timestamp takes a Unix timestamp or an RFC 3339 time with a timezone. --bookmark takes a bookmark that info prints.

Terminal window
npx wrangler d1 time-travel info <database-name>
npx wrangler d1 time-travel restore <database-name> --timestamp <time>

This overwrites the live database, including your own tables, and cancels queries in flight. Export first. The restored schema may be older than the deployed code. Check that the deployed commit’s migrations match the restored database before you serve traffic from it.

Put the copied objects back under the same keys with npx wrangler r2 object put <bucket>/<key> --remote --file <path>. While the CMS still holds the media, npm run backend:deliver with --media transfers its current public media as part of a full generation and delivery. It cannot bring back media the CMS no longer holds.

After the isolated copy passes verification, point production at it or repeat the restore in production. Keep the old database until the owner accepts the result. Re-enable processes that write data last.

Related: rollback and recovery, CMS backup and restore, detachment runbook.

Look up routes, authentication and deployment behavior in the API reference.


Unreleased / pre-MVP; no stable version
Source revision: fe23db481c422b40e317b92fc98116b4c0c26a87 (modified checkout)
Build date (UTC): 2026-10-18T09:22:34.630Z
Upgrade target: unavailable: modified checkout. Release notes