从 sqlite 迁移到 postgresql

0 database migration sqlite postgresql migrate

我有包含大量数据的 sqlite 数据库。我想将我的 sqlite 中的所有数据“复制”(迁移)到 postgres 数据库。有谁知道帮助将 sqlite 迁移到 postgres 的工具?我谷歌它,但没有找到一些东西。非常感谢您的帮助。

abi*_*ran 5

对我有用的是从 ruby​​ 运行续集。只需运行以下命令:

gem install sequel
Run Code Online (Sandbox Code Playgroud)

你需要在你的系统上安装postgres、sqlite 和 ruby开发包

运行命令:

gem install pg sqlite3
Run Code Online (Sandbox Code Playgroud)

在 postgresql 上创建一个空数据库,假设 testDB 并为用户分配授予权限

从命令提示符运行:

sequel -C sqlite:///path/to/sqlitedb.db postgres://user:password@host/testDB
Run Code Online (Sandbox Code Playgroud)

这将没有错误地运行。