Migrate MySQL database to PostgreSQL using EnterpriseDB Migration Toolkit - mysql

I'm trying to convert my MySQL database to PostgreSQL using EnterpriseDB Migration Tool. My setup is as follows:
Windows 10 x64
MySQL 5.5.52 Community Edition GPL
EDB PostgreSQL 9.6.2-2
EnterpriseDB Migration Toolkit 50.0.1
The issue is - it connects successfully to to source MySQL and target PostgreSQL but then fails with the error "unrecognized configuration parameter 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>
Anybody faced the same issue? Seems like a bug in EDB MTK but may be I'm missing something. Would be grateful for any help.

According to EDB's documentation, this is a parameter of their Postgres PLUS fork of PostgreSQL.
So it looks like this migration tool only works when you migrate to their proprietary version of PostgreSQL, not the standard version.

I think you should refer to
this tool's documentation.
According to this document, maybe you can try to add one more command line option:
C:\Program Files (x86)\edb\mtk\bin>runMTK -sourcedbtype mysql -targetdbtype postgresql s2c_data

I found the solution - DBTransfer. The original version was pretty old and buggy so I had to fix few things. The source is here. Feel free to use it for your projects.

Related

embulk - communication_link_failure

I want to ask about how to solve communication_link_failure error when I migrate mysql data to bigquery by using embulk. the table which I want to migrate is more than 1GB. I think that size is reason for error return.
How can I set my embulk config.yml file? Or how to migrate big table by using embulk.
communication_link_failure probably, Embulk can't connect MySQL server. I recommend you check the network setting.
If you can't solve the issue, Could you tell me the following?
Embulk version:
Java version: java -version
OS version
Embulk config (remove sensitive information)
Error message (Embulk run result)

How to set-up Hybris 6.7 local with MySQL

I am trying to set-up a local Hybris Instant with MySQL instead of HSQLDB.
local.properties
mysql.optional.tabledefs=CHARSET\=utf8 COLLATE\=utf8_bin
db.url=jdbc\:mysql\://localhost/6showcase?useConfigs\=maxPerformance&characterEncoding\=utf8&useSSL\=false
db.driver=com.mysql.jdbc.Driver
db.username=root
db.password=root
db.tableprefix=
mysql.tabletype=InnoDB
installed.tenants=**
Build Successfully(ant clean all).
Getting runti:
**ERROR [localhost-startStop-4] [DataSourceImpl] error connecting to DataSource having url jdbc:mysql://localhost/6showcase?useConfigs=maxPerformance&characterEncoding=utf8&useSSL=false: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long**
Using user root with all privileges for the schema etc...
Image1
Image2
Any idea what can be wrong?
You need exact db version, last or old version not supported. hybris 6.7 need MySQL 5.6 or 5.7 (with connector 5.1.x)
Full supported database list: https://help.hybris.com/6.7.0/hcd/8c71300f866910149b40c88dfc0de431.html
Follow
https://help.hybris.com/6.7.0/hcd/8c15bfb58669101484b7de3f3145855e.html
Please Note:
The MySQL connector is not shipped with SAP Hybris Commerce. Please download the file and put it in the ${HYBRIS_BIN_DIR}/platform/lib/dbdriver folder.

Trying to migrate SQL Server to MySQL using MySQL Workbench. Error: "[Microsoft][ODBC Driver Manager] Invalid argument value" when migrating data

Long time lurker, first time poster; hoping anyone can help me out.
Im using MySQL Workbench 5.2.41 to migrate a database from SQL Server to MySQL 5.0.8
The entire process goes smoothly: both SQL and MySQL connection Tests are good, the skemea and table create as expected, everything checks out until the 'Bulk Data Transfer' step. At that point I receive this error:
...
Migrating data...
wbcopytables.exe --odbc-source=DSN=SQL Server 11;DATABASE=;UID=sa --target=root#127.0.0.1:3306 --progress --passwords-from-stdin --thread-count=1 --table [GSAClosers_v2] [dbo].[AccountBase] `dbo` `AccountBase`
`dbo`.`AccountBase`:Copying 84 columns of 169530 rows from table [GSAClosers_v2].[dbo].[AccountBase]
ERROR: `dbo`.`AccountBase`:SQLGetData: HY009:10:[Microsoft][ODBC Driver Manager] Invalid argument value `dbo`.`AccountBase`:
Finished copying 0 rows in 0m00s
Copy helper has finished
...
For connectors I'm using Microsoft SQL Server / ODBC Data Source / DSN: SQL Server and for MySQL the IP and port(3306).
SQL Server 2012 Management Studio connects and all operations work as expected.
O, side not: both are on the same localhost machine.
If anyone can shed some light on this I would be forever indebted. Thanks in advance
From here:
[Microsoft][ODBC Driver Manager] Invalid argument value.
Regarding to the error message and code you provided, which seems is
database is invalid or cannot be accessed. That means either the
database does not exist or the user does not have permission to access
the database.
It turns out you need specify the instance after the server name, so
in the server name in the dialog box for creating the ODBC Data
Source, you must enter it as either: MyServer\SQLEXPRESS or
.\SQLEXPRESS
I think you may have a problem connecting to your database from wbcopytables.exe. Keep in mind that this is a separate tool so the fact that you can connect from the rest of the Migration Wizard doesn't imply that you will connect in wbcopytables.exe.
The thing that worries me the most is that your DSN has whitespace characters. This might be interpreted by the Windows terminal as independent command line parameters. One thing you can do is to edit your DSN name removing the whitespaces and try again.
You may also want to connect without a DSN by putting all your connection parameters explicitely as explained in my blog post: How-To: Guide to Database Migration from Microsoft SQL Server using MySQL Workbench.
And, by the way, since MySQL Workbench 5.2.42 is out you should go and get it. The Migration Wizard is pretty new so important bug fixes are likely launched in each recent Workbench release.
In either case I think you should file a bug with your issues with a detailed explanation about how to reproduce it, possible solutions, etc.
Hope this helps.
Ok, got it figured out: un-install java. install java 1.6, use MySQL Migration Tool. change all data types to varchar, ints and bits. run migrations....eat data.

Setting up Liquibase with MS-SQL Server

I am utilising Liquibase (www.liquibase.org) into our MVC3 SQL Server 2008 project to manage database migration/changes. However I'm stumbling on the first hurdle: Connecting to Microsoft SQL Server instance.
I am looking at the quick start tutorial on the liquibase site, but exchanging the mysql for sql server DB
I run this command:
liquibase --driver=sqljdbc.jar --changeLogFile="C:\Temp\ChangeLog.xml" --url="jdbc:sqlserver://localhost;databaseName=test" --username=user --password=pass migrate
And receive this error:
Liquibase Update Failed: Cannot find database driver: sqljdbc.jar
I have tried adding --classpath pointing to the sqljdbc driver with no luck.
How can I create or update an MS-SQL Server database with liquibase?
Create a properties file called liquibase.properties containing the following:
classpath=C:\\Program Files\\Microsoft SQL Server 2005 JDBC Driver\\sqljdbc_1.2\\enu\\sqljdbc.jar
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
url=jdbc:sqlserver://localhost:1433;databaseName=test
username=myuser
password=mypass
changeLogFile=C:\\Temp\\ChangeLog.xml
liquibase will use this file when located in the same directory. Useful to simplify the command-line.
Database is updated as follows:
liquibase update
Notes:
I'm not a SQL server user, I picked up the JDBC driver and URL details from Microsoft doco
The "migrate" command has been deprecated.

Migrate Data and Schema from MySQL to SQL Server

Are there any free solutions for automatically migrating a database from MySQL to SQL Server Server that "just works"?
I've been attempting this simple (at least I thought so) task all day now. I've tried:
SQL Server Management Studio's Import Data feature
Create an empty database
Tasks -> Import Data...
.NET Framework Data Provider for Odbc
Valid DSN (verified it connects)
Copy data from one or more tables or views
Check 1 VERY simple table
Click Preview
Get Error:
The preview data could not be
retrieved. ADDITIONAL INFORMATION:
ERROR [42000] [MySQL][ODBC 5.1
Driver][mysqld-5.1.45-community]You
have an error in your SQL syntax;
check the manual that corresponds to
your MySQL server version for the
right syntax to use near
'"table_name"' at line 1 (myodbc5.dll)
A similar error occurs if I go through the rest of the wizard and perform the operation. The failed step is "Setting Source Connection" the error refers to retrieving column information and then lists the above error. It can retrieve column information just fine when I modify column mappings so I really don't know what the issue is.
I've also tried getting various MySql tools to output ddl statements that SQL Server understand but haven't succeeded.
I've tried with MySQL v5.1.11 to SQL Server 2005 and with MySQL v5.1.45 to SQL Server 2008 (with ODBC drivers 3.51.27.00 and 5.01.06.00 respectively)
There are two free toolkits provided by Microsoft.
Microsoft SQL Server Migration Assistant for MySQL v1.0
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=14280
Microsoft SQL Server Migration Assistant for MySQL v5.1
http://www.microsoft.com/download/en/details.aspx?id=26712
I have used only the second one and it worked for me without any glitch.
It required registration with Microsoft for downloading a license file.
But it is free to use for everyone.
This is really old now, but if you use MySQL Connector NET and set SQL Server Mode = true in the connection string, this will resolve your error.
Recently, I have successfully migrated the MySQL database to MSSQL database. Below are detailed steps:
Operating System: AWS Microsoft Windows Server 2012 R2 with SQL Server Standard
Tools Used:
SQL Server 2014 Management Studio SQL Developer,
Microsoft SQL Server Migration Assistant v6.0.1 for MySQL,
Remote Desktop Client, and
Third Party MySql ODBC Driver 5.1.13
1. Setup AWS Windows Server
2. From the AWS console ec2 instance list, right click on the windows server and select connect. You would see the similar screen below.
3. Click on the Get Password button which will be required for Remote Desktop connection[#4] and follow the instructions.
4. Connect to that EC2[#1] instance with the Remote Desktop Client by default available in your Ubuntu local machine. Use the credentials from #2.
5. Once you get connected using the remote client, you should be able to access the remote MSSQL server. Install the following tools.
Install Chrome : Since internet explorer has some security, install chrome.
Install Microsoft SQL Server Migration Assistant v6.0.1 for MySQL
https://www.microsoft.com/en-us/download/details.aspx?id=51218
Install Third Party MySql ODBC Driver 5.1.13
https://dev.mysql.com/downloads/connector/odbc/5.1.html
6. Configure ODBC Data Sources(64-bit) :
Open Administrative tools → click on ODBC Data Sources(64-bit) and
follow the steps to connect to MySQL database.
7. Open SQL Server 2014 Management Studio SQL Developer and connect using windows authentication.
Create destination MSSql database for MySql migration.
8. Open Microsoft SQL Server Migration Assistant : For detail visit this link: https://blogs.msdn.microsoft.com/ssma/2011/02/07/mysql-to-sql-server-migration-how-to-use-ssma/
Create new project
Connect to MySql
Connect to MSSql
Convert Schema
Migrate Data
8. You might have some problem listed here. Please read in detail where I have written the detail resolution.
MySql 5.6 to MSSql server 2014 migration : ExecuteReader requires an open and available Connection
I am afraid there is no simple solution. SQL used in MySQL and T-SQL used in SQL Server 200X are different dialects of SQL. It is not only simple changing say "auto_increment" to "identity", but reserved words that creates a problem.
For example
CREATE TABLE test (
user varchar(50)
)
will work in MySQL and fail in SQL Server 2008.
To cut long story short - unfortunately, you will need to do it by hand.
Export the file from MySQL to a CSV file.
Export the create statements for the tables from MySQL
Cry.
3a. Disable foreign key checks in SQL server
Tune the create statements in SQLserver until they work.
Import the CSV files in to MySQL.
5a. Enable foreign key checks in SQL server.
Also see these answers:
migrate-from-mysql-to-sql-server-2008
Had similiar issue about this error 42000, and for me I figured out that setting the MySQL global mode to ansi_quotes would solve it:
set global sql_mode=ansi_quotes;
There are commercial solutions, but not free solutions. Depending on complexity of your database, rewriting SQL for target dialect can be trivial task - or a very hard one.
Rewriting CREATE TABLE statements is never hard, it can be done by hand with no surprises. Procedures, functions and triggers are problematic.