Workflow for copying tables from remote Postgres DB to another remote DB using Prisma ORM

92 Views Asked by At

I am using Postrgres database with Prisma ORM, on a Next JS application. I am using the databases for storing content of a website (literally the copy of each page and components). The schema should be 100% the same between to DBs.

I have testing and production databases. The test database will get updated on a regular basis. I am looking to build a feature that when the test DB gets updated, I migrate all the changes to the live DB.

To copy the data from test to live, I want to be able to:

  • Backup the production DB (having the ability to restore it to its previous state if something goes wrong)
  • Synchronize Schema (although two schema are the same, just to be safe)
  • Data migration (inserting/updating actual changes from the test DB to the production one)

I have used Prisma Migrate tool to create a process for updating database schema updates but I could not find a way for updating records of a table from one database to another.

0

There are 0 best solutions below