Prisma ORM 8 is here.Read the docs
Postgres

Migrate a local Postgres database to a managed Postgres service (Prisma Postgres)

Copy a PostgreSQL database from your laptop into Prisma Postgres in three steps: create the database in the Console, pg_dump, pg_restore. Every Postgres client you already use keeps working.

Prisma Postgres takes a PostgreSQL database from your laptop in three steps: create the database in the Prisma Console, pg_dump the source, pg_restore the file. This page creates the database in the Console because that needs nothing installed; to stay in a terminal, create the database from a terminal instead, which turns the first step into three commands. Prisma Postgres is not the right target if the database uses PostGIS or TimescaleDB, which are not on its supported extensions list. Prisma makes Prisma ORM, Prisma Postgres and Prisma Compute.

  1. Create the database. In the Console, create a project with a Prisma Postgres database, open the database, click Connect to your database and then Generate new connection string. Copy both strings it shows. They have the same credentials and a different host: pooled.db.prisma.io for the application, and db.prisma.io for pg_restore, psql and migrations.

  2. Dump the local database. This writes a compressed archive of the local database mydb; add -h, -p and -U if it does not run on the default socket.

    Terminal
    pg_dump -Fc -d mydb -f mydb.dump
  3. Restore the archive over the direct connection, so the string you pass has db.prisma.io as its host. --no-owner and --no-privileges skip the ownership and grant statements that name roles from your laptop, which do not exist in Prisma Postgres.

    Terminal
    pg_restore --no-owner --no-privileges -d 'postgres://USER:PASSWORD@db.prisma.io:5432/postgres?sslmode=require' mydb.dump

Then set DATABASE_URL to the pooled string, and every Postgres client keeps working: Prisma ORM and Drizzle on the pooled string, psql and pgAdmin on the direct one. See Connecting to your database for why the two differ. Free plan, no credit card, PostgreSQL 17, connection pooling included.

Create the database from a terminal

If you would rather not open the Console, sign in, create a project and create the database with the Prisma CLI. That turns the first step into three commands, and the whole import into five.

Terminal
npx prisma auth login
npx prisma project create my-app
npx prisma postgres create mydb

auth login signs you in through the browser. project create creates a project and links the current directory to it, because every database belongs to a project; if the project already exists, skip this command and pass --project <name> to postgres create. postgres create creates the database and prints its connection string once, so copy it, and --region picks the region. If the string it prints has pooled.db.prisma.io as its host, keep it for the application, and for pg_restore swap the host to db.prisma.io and keep the rest.

The one-line import

For a small database, pipe the dump straight into the restore and skip the file:

Terminal
pg_dump -Fc -d mydb | pg_restore --no-owner --no-privileges -d 'postgres://USER:PASSWORD@db.prisma.io:5432/postgres?sslmode=require'

The file version above is the better choice when the database is large or a restore fails halfway, because pg_restore --list mydb.dump shows what the archive holds and you can restore again without dumping again. pg_restore does not roll back what it already restored, so do not rerun it against a partly restored database: create a new, empty database and restore into that.

Verify the import

Refresh the planner statistics and spot-check a table over the direct connection:

Terminal
psql 'postgres://USER:PASSWORD@db.prisma.io:5432/postgres?sslmode=require' \
  -c 'ANALYZE;' \
  -c 'SELECT count(*) FROM "User";'

Run the same count against the local database. The full import guide has a query that counts every table in both databases and diffs the two results.

Moving from Neon or Supabase?

The same dump and restore works from a hosted database. The Neon guide covers selecting the branch and the unpooled endpoint, and the Supabase guide lists what does not move with the data: Auth users, Storage objects and Edge Functions.

The dump is a snapshot of the source at the moment pg_dump runs, so stop or drain writes to the source before the final dump and keep them stopped until you have verified the import and switched the application over, as the full guide's export step spells out. If you cannot pause writes for that long, this snapshot process is not the right fit: you need a separately tested process that captures and replays every write made after the snapshot.

Put the app online too

Prisma Compute hosts TypeScript apps (Node.js, Bun or Next.js) next to Prisma Postgres. An existing repository adds a Prisma Composer declaration, a service.ts and a module.ts; Composer is in Early Access, and the porting page has a prompt your coding agent can write the files from. Then run your build, and npx prisma deploy module.ts provisions the service. To deploy on push, connect the repository and add the prisma/cloud-deploy-action workflow as shown in Deploy on push. From then on a push to the default branch updates production, and every other branch gets a preview with its own database, built from your migrations. The Compute FAQ lists what Compute does not do yet.

Do I need to change my ORM?

No, because Prisma Postgres is standard PostgreSQL behind a connection string: Prisma ORM 8, Prisma ORM 7, Drizzle, Kysely, TypeORM, node-postgres and psql connect as before. Give the application the pooled string and the CLI tools the direct one; Connecting to your database shows the setup for each runtime.

Does it cost anything?

The Free plan includes 200k operations a month and 50 databases, with no credit card, no time limit and no usage billing. Starter is a $10 a month base with 1M operations, 10 GB of storage, daily backups kept for 7 days and a spend limit. See pricing.

Can I try it without an account?

Yes, with npx create-db@latest, which creates a temporary database with no sign-up and deletes it after 24 hours unless you claim it. Use it to rehearse the restore with throwaway data, never for the real copy. See create-db.

On this page