#Dump db

4 messages · Page 1 of 1 (latest)

zenith verge
#

How to dump whole db from dev enviroment and inster to prod enviroment

grim ledgeBOT
#

Hi @zenith verge. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

You can copy your entire Convex dev database into prod using backups/exports plus npx convex import.

1. From the dashboard (simplest)

  1. Go to your dev deploymentSettings → Backup & Restore.
  2. Click “Backup now” (or download an existing backup). This gives you a ZIP snapshot of all tables (and optionally file storage). [Backup & restore]
  3. Switch to your prod deploymentSettings → Backup & Restore.
  4. Use Restore and select that backup. This wipes existing prod data and replaces it with the backup. [Backup restore]

IDs and _creationTime are preserved, and storage file IDs are kept if included. [Backup download; Storage IDs]

2. From the CLI (same format as backups)

On your dev project:

# Export full dev deployment to a ZIP
npx convex export --path ./dev_snapshot.zip

This ZIP has all tables and (optionally) storage, same as a dashboard backup. [Data export; Backup format]

Then, to import into prod:

npx convex import --prod --replace dev_snapshot.zip
  • --prod targets the production deployment.
  • --replace overwrites data in tables present in the ZIP. [Data import]

This preserves document IDs and references. [Import ZIP]


If you only need some tables (not the whole DB), you can instead export/import per-table CSV/JSON/JSONL with:

#
npx convex import --table <tableName> <path>      # dev or prod with --prod

[Single-table import]

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: