Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use flyway to migrate data from one DB to another DB?

I have two postgreSql DB on different server lets say A and B. Can I use flyway some how to copy all data from DB A to B which is newly setup and empty. Its will be helpful if anyone point me to correct direction and tool, requirement is to copy data from one DB to another through some tool automation huge data volume need to consider in solution.

like image 947
Gan Avatar asked Oct 28 '25 04:10

Gan


1 Answers

Flyway doesn't directly support such a capability. However, you could do the following:

  • As Laurenz says, use pg_dump to extract DB A into a script file
  • Create a Flyway migration script and copy in the contents of the script file
  • Run the Migrate command against DB B
like image 110
Mikiel Avatar answered Oct 30 '25 18:10

Mikiel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!