#Working with teams in convex

4 messages · Page 1 of 1 (latest)

verbal crystal
#

We’re working on a team project using Convex and have a question regarding collaboration and syncing changes across team members' cloud development environments.

Scenario:
We have two developers: George and Alex.
Both are using separate Convex cloud development environments and have .env.local automatically configured via npx convex dev in their respective Next.js projects.
Each developer makes changes in their own development environment and tests locally.
Once satisfied, Alex deployed the changes to production using npx convex deploy.

Question:
Now, George wants to get the latest Convex function changes (deployed by Alex) into his own Convex cloud development environment. Is there a supported way to:
Pull Convex backend function changes from the production deployment (or another teammate’s deployment)?
Or alternatively, sync a local Convex project with what’s currently deployed in production?

golden ridgeBOT
#

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

#

I understand your team collaboration scenario with Convex. Let me explain how development environments work in Convex and address your specific question about syncing changes between team members.

In Convex, each team member gets their own isolated development deployment. This is by design to allow developers to work independently without stepping on each other's toes. When someone deploys to production using npx convex deploy, those changes go to the shared production deployment, but don't automatically sync to other developers' environments.

For George to get Alex's changes that are now in production, he has a few options:

  1. Pull the latest code from your shared Git repository: The recommended workflow is to have all team members pull the latest code changes from your shared Git repository (GitHub, GitLab, etc.). Once George has the updated code locally, his Convex development environment will reflect those changes when he runs npx convex dev.

  2. Export/Import data if needed: If George also needs the data that Alex created, he can use the backup/restore feature to populate his dev deployment with data from production:

    npx convex export
    npx convex import --prod
    

    CLI documentation provides more details on these commands.

This separation of development environments is intentional in Convex's team workflow. As mentioned in the documentation:

"All team members can make backend changes and test them out with their individual dev deployments. When a change is ready the team member opens a pull-request (or commits to a shared branch)." Deploying Your App to Production

#

There isn't currently a direct way to "pull" function changes from production to a development environment without going through your code repository. This is because Convex treats each deployment as a separate instance with its own code and data to prevent conflicts during development.

The typical workflow is:

  1. Pull latest code from Git
  2. Run npx convex dev to update your development environment
  3. Test changes locally
  4. When ready, deploy to production with npx convex deploy

This approach ensures all team members are working with the same codebase while maintaining isolated environments for testing.

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