apps/docs/content/docs/orm/prisma-client/deployment/deploy-migrations-from-a-local-environment.mdx
There are two scenarios where you might consider deploying migrations directly from a local environment to a production environment.
This page outlines some examples of how you can do that and why we would generally not recommend it.
If you do not have an automated CI/CD process, you can technically deploy new migrations from your local environment to production in the following ways:
prisma migrate dev, which will generate a migration history from the latest changes made.// [!code --]
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/my_local_database"
// [!code ++]
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/my_production_database"
prisma migrate deploy⛔ We strongly discourage this solution due to the following reasons
✅ We recommend setting up an automated CI/CD pipeline
The pipeline should handle deployment to staging and production environments, and use migrate deploy in a pipeline step. See the deployment guides for examples.
When you add Prisma Migrate to an existing database, you must baseline the production database. Baselining is performed once, and can be done from a local instance.