#Sync Data from Dev To Prod
1 messages · Page 1 of 1 (latest)
Hi @sharp bone. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To sync data from your development environment to your production environment in Convex, you have several options:
Using Export and Import
The most straightforward way is to export data from your development deployment and import it into your production deployment:
-
Export your development data using the CLI:
npx convex export --path ~/DownloadsThis will create a zip file containing your data Data Export.
-
Import this data to your production deployment:
npx convex import --prod --replace backup.zipThe
--replaceflag will replace existing data in the tables mentioned in the ZIP file Data Import.
Using Backup and Restore
Alternatively, you can use the backup and restore functionality:
- Take a backup of your development deployment from the dashboard
- Download the backup as a zip file
- Restore this backup to your production deployment either through the dashboard or using the CLI command mentioned above Data Import & Export
Important Notes
-
When importing data from a backup ZIP file, documents will retain their
_idand_creationTimefields, ensuring that references between tables are maintained Data Import. -
Data import is the only way to create documents with pre-existing
_idand_creationTimefields, which is important for preserving relationships between documents Data Import.
- If you're working with preview deployments, you can also seed them with data from your development or production environments Seeding Data for Preview Deployments.