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.db
Denoflare uses the standard
CLOUDFLARE_ACCOUNT_ID
andCLOUDFLARE_API_TOKEN
env vars, or explicit command options (seedenoflare d1 export-db
for help), or a local config file to authenticate