如何使用flyway将数据从一个DB迁移到另一个DB? [英] How to use flyway to migrate data from one DB to another DB?

查看:249
本文介绍了如何使用flyway将数据从一个DB迁移到另一个DB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在不同的服务器上有两个postgreSql DB,可以说A和B。
我可以使用flyway一些如何将所有数据从DB A复制到B并重新设置为空。
如果有人指出我正确的方向和工具,这将很有帮助,要求是通过某种工具自动化将数据从一个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.

推荐答案

Flyway不直接支持这种功能。但是,您可以执行以下操作:

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


  • 如Laurenz所说,请使用 pg_dump 将DB A提取到脚本文件中

  • 创建Flyway迁移脚本并复制脚本文件的内容

  • 运行针对DB B的迁移命令

  • 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

这篇关于如何使用flyway将数据从一个DB迁移到另一个DB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆