migrating a table full with data from MSSQL to MYSQL - mysql

I'm importing data from SQL Server to mysql.
Currently I need to migrate a single a table with a simple data structure (no constraints, only values), to mysql. The table is 1.6 milion rows
What is a good way to accomplish this?
(I saw other related topics here, but don't see something that I can work with)

The best approach is to write a program using your favorite language to migrate the data. If you are looking for a tool to accomplish this, have a look at MySQL Migration Toolkit. It migrates data from various data sources to MySQL database.
MySQL Migration Toolkit.

You could use SSIS, it can connect to ODBC data destinations and might be quicker to implement than writing an application from scratch.

Related

Oracle to MariaDB data migration

We are in the process of migrating a fairly large Oracle database (approx. 200 tables) to MariaDB. We used CA ERwin to help create the MariaDB schema objects, and are now trying to figure out the best way to migrate the data. For example, if I use SQL Developer's export utility, the resulting Insert statements are created with Oracle syntax, which can differ quite a bit from MariaDB's syntax. Rather than handling every set of Inserts on an individual basis, I'm hoping somebody has been through this before and can suggest an alternative.
We looked at the MySQL Workbench Migration Wizard, but it doesn't directly support migration from Oracle to MariaDB/MySQL (no surprise as Oracle owns MySQL).
Has anybody come across a utility that will make this task easier and save time? Thanks.

MySQL to pgSQL migration

We have a fairly large MySQL database with more than a million rows of data with every possible data type.
It is a part of a custom MVC application built more than 5 years ago. We have to migrate it now.
There are a large number of queries and insert statements which we want to replace with JSON based web services so that it can be used with every kind of app/device etc.
A large number of PHP functions have been fused with display logic making it tricky. Also there are also a few MySQL functions in the bundle.
Please share tips/suggestions/tools that would be useful for this migration.
There are some tools which I can suggest you to convert your Mysql database to Pgsql one here is some of them:
pgloader
PostgreSQL Data Wizard
pgloader
dataPro
And based on my experience, I suggest you pgloader to load data from MySQL, SQLite, MS SQL Server, dBase files, CSV files and fixed-width data files, and more. Released under The PostgreSQL Licence..

Migration from MySQL to Postgresql with auto-increments - how?

I'm considering a MySQL to Postgresql migration for my web application, but I'm having a really hard time converting my existing MySQL database to Postgresql.
I tried :
mysldump with --compatible=postgresql
migration wizard from EnterpriseDB
Postgresql Data Wizard from EMS
DBConvert from DMSoft
and NONE of the above programs do a good job converting my database!
I saw some Perl and Python scripts for converting mysql to postgresql, but I can't figure out how to use them....(I installed ActivePerl and don't understand what I'm supposed to do next to run that script!)
I use Auto Increment fields (as a primary key) all the time, and these are just ignored... I understand that Postgresql does auto-increments in another way (with sequences), but it can't be THAT hard for MIGRATION software to implement that, or is it?
Did anybody have better luck converting a MySQL database with auto-increments as primary keys?
I know this is probably not the answer you are looking for, but: I don't believe in "automated" migration tools.
Take your existing SQL Scripts that create your database schema, do a search and replace for the necessary data types (autonumber maps to serial which does all the sequence handling automagically for you), remove all the "engine=" stuff and then run the new script against Postgres.
Dump the old database into flat files and import them into the target.
I have done this several times with sample databases that were intended for MySQL and it really doesn't take that long.
Probably just as long as trying all the different "automated" tools.
Why not use an ETL Tool? you dont have to worry about dumps or stuff like that.
I have migrated to PostgresSQL and MySQL and have had no problems with the auto increment fields.
You just need to know the connection credentials and thats it. I personally use Pentaho ( it's open source ).
Download Pentaho ETL from http://kettle.pentaho.org/
Unzip and run Pentaho (using .bat file spoon.bat)
Create a new Job:
Create DB connection for source data base (PostgreSQL) - using menu: Tools→Wizard→Create DataBase Connection (F3) Create DB connection for destination data base (Mysql) - using technique described above.
Run the Wizard: Tools → Wizard → Copy Tables (Ctrl-F10).
Select source (left dialog panel), and destination (left dialog panel). Click Finish.
The Job will be generated - Run the job.
If you need any help let me know.
Even when you familiar with all "PostgreSQL gotchas", doing every step by hand may take a lot of time, especially when your db is "big".
Try some other scripts/tools.
I know this is an old question but I just ran into the same problem migrating from MySQL to Postgres. After trying several migration tools out the very best one I could find, which will migrate your database structure as cleanly as possible, was Pgloader https://github.com/dimitri/pgloader/ it will take care of changing the Auto Increment to Postgres sequences no problem and it's super fast.

How I do to "migrate" the structure from aspnetdb.mdf to a mysql database

I'm creating a new Asp.Net MVC 3 application. Visual Studio does a lot of the job of create the database and initial layout. Very nice! I will upload that initial files to my server, but I want that it runs using the MySql database on the server.
There's some quick/easy way to do it? I'm not worried about the data, just the structure of the tables, and the connection/configuration changes.
Thank you very much!
You can export any MS-SQL database as a Script (Sql Server manager).
Fix it up to make it compatible.
But you will also need a Membership provider, look around if there exist any for MySql, otherwise you'll have to create one (movie).
There are a number of tools listed in "Migrating from Microsoft SQL Server and Access to MySQL".
Or (assuming that you're using column types that exist on both platforms) you can write a script to convert a schema dump from SqlServer into MySQL (or do the conversion by hand in a text editor). Even better yet, you can write a program program to read the INFORMATION_SCHEMA table from SqlServer and produce the necessary CREATE TABLE... statements in mysql. Lots of options.

How to populate data for MySQL and Oracle?

I have to create SQL script with test data.
I would like to find a tool/mechanism to:
specify dataset only once
have it load data to MySQL and Oracle
it can create native SQL or just perform inserts, I don't care
Can you guys recommend good tool for that?
From what I get, I would recommand you to write the test datas in an XML/CSV file and create ETL Batch to load your database.
Take a look at Kettle, free and easy to use.
Hope I could help,
you might also look at Oracle's SQL Developer product - free and can connect to both DBs and load and export data and do SQL. http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
*There is also a free data modeler for modeling (and reverse engineering ) databases.