使用EnterpriseDB迁移工具将MySQL数据库迁移到PostgreSQL

使用EnterpriseDB迁移工具将MySQL数据库迁移到PostgreSQL

问题描述:

我试图使用EnterpriseDB迁移工具将我的MySQL数据库转换为PostgreSQL。我的设置如下:使用EnterpriseDB迁移工具将MySQL数据库迁移到PostgreSQL

  • 的Windows 10的x64
  • MySQL的52年5月5日社区版GPL
  • 教育局的PostgreSQL 9.6.2-2
  • EnterpriseDB的迁移工具包50.0.1

问题是 - 它成功连接到源MySQL和目标PostgreSQL,但随后出现错误“无法识别的配置参数db_dialect”:

C:\Program Files (x86)\edb\mtk\bin>runMTK -sourcedbtype mysql s2c_data 

Running EnterpriseDB Migration Toolkit (Build 50.0.1) ... 

Source database connectivity info... 
conn=jdbc:mysql://localhost:3306/s2c_data?zeroDateTimeBehavior=convertToNull 
user =s2c_data_user 
password=****** 


Target database connectivity info... 
conn =jdbc:edb://localhost:5432/s2c_data 
user =s2c_data_user 
password=****** 


Connecting with source MySQL database server... 
Connected to MySQL, version '5.5.52-log' 
Connecting with target EDB Postgres database server... 
Connected to PostgreSQL, version '9.6.2' 

Importing mysql schema s2c_data... 
MTK-17003:Error in copy tables: java.sql.SQLException: com.edb.util.PSQLException: ERROR: unrecognized configuration parameter: "db_dialect" 
MTK-03000: General Error DB-null: java.sql.SQLException: java.sql.SQLException: java.sql.SQLException: com.edb.util.PSQLException: ERROR: unrecognized configuration parameter: "db_dialect" 


One or more schema objects could not be imported during the migration process. Please review the migration output for more details. 

Migration logs have been saved to C:\Users\Alex_R\.enterprisedb\migration-toolkit\logs 

******************** Migration Summary ******************** 

Total objects: 0 Successful count: 0 Failed count: 0 Invalid count: 0 

************************************************************* 

C:\Program Files (x86)\edb\mtk\bin> 

有人遇到同样的问题?看起来像EDB MTK中的错误,但可能是我错过了一些东西。将不胜感激任何帮助。

根据EDB's documentation,这是PostgreSQL的Postgres PLUS fork的一个参数。

所以它看起来像这个迁移工具只适用于你迁移到他们专有版本的PostgreSQL,而不是标准版本。

+0

嗨,Laurenz,谢谢你,我认为你是对的,但是这是我不明白的 - 我使用EDB安装程序/ Stack Builder完成了服务器和MTK的全新安装,因此它们来自同一个软件包。可能是我太天真了,以为他们应该是兼容:) –

+1

我会问教育局,如果我是你 - 这是他们的产品。 –

我想你应该参考 this tool's documentation

根据这一文件,也许你可以尝试添加更多的命令行选项:

C:\Program Files (x86)\edb\mtk\bin>runMTK -sourcedbtype mysql -targetdbtype postgresql s2c_data 
+0

试过了,它没有帮助。我最终在git上分发了DBTransfer,修复了所有的错误,并设法将我的数据库移动到所有PK,FK,排序,约束和视图。这是通用的,所以任何人希望改善它,请欢迎 https://github.com/abratchik/dbtransfer –

我找到了解决办法 - DBTransfer。原来的版本是相当古老和越野车,所以我不得不修复几件事情。来源是here。随意使用它为您的项目。