#how to duplicate dev to prod

3 messages · Page 1 of 1 (latest)

stone oar
#

i staged everything in dev, would like to duplicate to prod

azure folioBOT
#

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

#

To duplicate your Convex dev deployment to prod (including data and environment variables), follow these steps:

  1. Export your dev data:
    Run the following command from your dev deployment to export your data:

    npx convex export
    

    This will create a data export file.

  2. Import data into prod:
    Use the export file to import data into your production deployment:

    npx convex import --prod
    

    This will populate your prod deployment with the same data as your dev deployment.

  3. Export and import environment variables:

    • List your dev environment variables:
      npx convex env list
      
    • Set each variable in prod using:
      npx convex env --prod set <name> <value>
      

    This ensures your prod environment matches your dev environment.

  4. Deploy your code to prod:
    Once your data and environment variables are set, deploy your code:

    npx convex deploy
    

This process will duplicate your dev environment (code, data, and env vars) to production. Note that dev and prod are intentionally separate to prevent accidental overwrites, so this is a manual, one-time process for migration or duplication purposes Discord support thread Env variables thread.

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