New one-liner command to download a Cloudflare D1 database to a local sqlite db file.
Prerequisites:
Install the latest Denoflare CLI (newest commit, not release-tagged yet) if not already installed
- Install deno if not already installed
- Then install Denoflare:
deno install -A --name denoflare --force https://raw.githubusercontent.com/skymethod/denoflare/66b741c9242e724adbf030a2be26af4b58432631/cli/cli.ts
Run the new denoflare d1 export-db command
denoflare d1 export-db your-d1-database-name --file /path/to/exported.dbDenoflare uses the standard
CLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_API_TOKENenv vars, or explicit command options (seedenoflare d1 export-dbfor help), or a local config file to authenticate