-1

I have two different DBs,

  1. the Development environment.
  2. The other is for production like environment.

Whenever development is completed on the Development environment, data from specific reference tables need to be synced onto DB 2 (production).

So, to achieve the required changes on those tables whether there be CRUD, I'm thinking of selecting data from all relevant tables and mapping with tables on DB2(production).

For records not present in DB2(production) and present in DB1(development), I'll create an insert. Similarly, for delete and update.

Is there any better way to create or find out the delta between these two DBs(development & production)?

Dushyant Tankariya
  • 1,432
  • 3
  • 11
  • 17
  • When deploying to prod, don’t you first shutdown the live database and make a backup copy? Bring that copy to the dev server, replacing its outdated database. If you have other issues that make this obvious solution untenable, edit your Question to explain. – Basil Bourque Jul 30 '19 at 16:13

1 Answers1

2

For schema migration try to use Liquidbase or Flyway for database migration. It is working similar to Git - You will have history of every change done in Your database.

Then for data migration You could easily crate data backup (DB1) and load it on another database (DB2).

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
akaras
  • 54
  • 1
  • 7