Migrate to Prisma Postgres
How is the easiest way to migrate my current postgres to a prisma postgres (already use prisma as orm)? Is there a way to import a backup file or whatever?
6 Replies
You chose to compile with the bot. One moment while I piece together your answer…
The easiest way to migrate your current PostgreSQL database to Prisma Postgres—when you’re already using Prisma ORM—is as follows:
1. Back up your existing PostgreSQL database
Use
In the Prisma Console, create a new Prisma Postgres instance and get its connection string. 3. Connect to Prisma Postgres using a tunnel
Set your new Prisma Postgres connection string as an environment variable: Then run: Keep this process running Import data into Prisma Postgres. 4. Restore your backup into Prisma Postgres
In a new terminal, run: This imports your data into Prisma Postgres. 5. Update your Prisma project
- Update your
Use
pg_dump
to export your data:
Replace __DATABASE_URL__
with your current database connection string. This creates a backup file (db_dump.bak
) of your data Import data from an existing database.
2. Create a new Prisma Postgres databaseIn the Prisma Console, create a new Prisma Postgres instance and get its connection string. 3. Connect to Prisma Postgres using a tunnel
Set your new Prisma Postgres connection string as an environment variable: Then run: Keep this process running Import data into Prisma Postgres. 4. Restore your backup into Prisma Postgres
In a new terminal, run: This imports your data into Prisma Postgres. 5. Update your Prisma project
- Update your
.env
file with the new Prisma Postgres connection string.
- Install the Accelerate extension:
- Extend your Prisma Client:
- Re-generate Prisma Client:
Update your application code
That’s it! Your app will now use Prisma Postgres.Hey @foxyyy!
Was the bot response helpful?
Please let me know if you face any issues while trying to migrate to Prisma Postgres
yes he was although I did not yet started as I'm still unsure if I want to migrate (currently deciding between prisma and neon)
https://x.com/prisma/status/1951266173796098382
ok I guess the decision has answerd itself.
Prisma Postgres (@prisma)
Prisma Postgres is now 5x cheaper, what will you build next?
See the new pricing👇
https://t.co/VNMnMoEmDA

X
bdw Are there any plans for database branching or creating an identical copy of your actuall database with prisma dev?
Yes, we want to add support for branching in future