#Sync Data from Dev To Prod

1 messages · Page 1 of 1 (latest)

sharp bone
#

How can I sync my data from dev to prod

oblique troutBOT
#

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:

  1. Export your development data using the CLI:

    npx convex export --path ~/Downloads
    

    This will create a zip file containing your data Data Export.

  2. Import this data to your production deployment:

    npx convex import --prod --replace backup.zip
    

    The --replace flag 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:

  1. Take a backup of your development deployment from the dashboard
  2. Download the backup as a zip file
  3. 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 _id and _creationTime fields, ensuring that references between tables are maintained Data Import.

  • Data import is the only way to create documents with pre-existing _id and _creationTime fields, which is important for preserving relationships between documents Data Import.

#

Remember that data import is currently a beta feature, so if you encounter any issues or have feedback, you can reach out to the Convex team on Discord.

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