MSSQL TO MySQL database Migration - mysql

I need a working tool for migrate DDL objects and data tables from MS SQL Server to MySQL. I checkout Database Migration Wizard in MySQLWorkBench 6.3,i have also tested with Ispirer tool (not free) and i can migrate only tables and data in tables but not views, store procedures and functions (maybe trigger not)..
In this MySQLWorkbench tools page : https://dev.mysql.com/doc/workbench/en/wb-migration-overview.html i found
"d.View objects are copied, and commented out if the source is not MySQL.
e.Stored Procedure and Function objects are copied, and commented out if the source is not MySQL."
So, i'm confused about why copy them and comment-out and not try to convert syntax? we know that database source is MSSQL so the syntax is different from mysql? I think it's impossible write mysql objects in MSSQL Server..no?
Thanks
Roby

Yes, the syntax is different in MySQL. The conversion process is too complicated to do it automatically, however we gave the possibility to convert it manually. So if you want migrate those views/procedures, you must uncomment it and rewrite to MySQL compatible sql.

Related

Migrate only Stored procedure from SQL Server to mysql automatically

When we migrate from SQL Server to mysql only table structure and data transfer, stored procedures, views and triggers don't transfer. Is there any why to transfer stored procedures and triggers using mysql migration help or any other tool? I'll be very thankful to help me. Why stored procedures and views do not transfer while I select both check boxes in ysql Workbench?:
The problem is that transferring database objects that contain code is not really straightforward and myqsl workbench does not transfer them automatically. See mysql workbench documentation on Migrating from supported databases:
Generally speaking, only table information and its data are automatically converted to MySQL. Code objects such as views, stored procedures, and triggers, are not. But supported RDBMS products will be retrieved and displayed in the wizard. You can then manually convert them, or save them for converting at a later time.
I agree, this should be made more clear in the user interface of mysql workbench. There are other migration tools that claim to be able to automatically migrate such objects between ms sql and mysql (recommending tools is out of scope, but with some google serach you will find them), but I have yet to see an application that can truly migrate complex code from one rdbms to another.

MySQL structure to SQLite

I am trying to use MySQL workbench to export my model to SQLite. I don't need the data just the structure. Do you have any suggestion? Exporting to SQL and creating tables with SQLite3 using that won't work as there are several differences between MySQL and SQLite syntaxes.
From what I know there's no tool that can convert a MySQL SQL script to SQLite. You will probably have to manually rework the generated SQL. Or you could create a MySQL schema from your model and use one of the available tools to convert that schema. Needs a detour via an existing MySQL schema, however.

Move data from MS SQL to MySQL

I have one MS SQL DB (very big) and MySQL. I must move data from MS SQL DB to MySQL by doing SQL. It mean that source data & destination data arenot same structure. When source data is updated, the updating is reflected into destionation. Please give me an advice which is the suitable way?
Using SSIS
Using store procedure & write my own script
Other way.
Any advice is highly appreciated.
Cleanest way will be using stored procedures since it is not a complete immigration. By doing this you will have everything under control. MSSQL has a nice feature linked servers, a bit slow but worths it in most of cases. You can find instructions here: http://www.sqlservercentral.com/Forums/Topic340912-146-1.aspx
An example:
UPDATE your_mysql_database.dbo.your_mysql_table SET col1=...
To migrate from MSSQL to MYSQL, Please use MYSQL Migration Toolkit
To download and use the MYSQL Migration Toolkit, Please use the following link http://dev.mysql.com/downloads/gui-tools/5.0.html
The MySQL Workbench Migration Wizard is designed to save DBA and developer time by providing visual, point and click ease of use around all phases of configuring and managing a complex migration process:
Database migrations - enables migrations from Microsoft SQL Server, PostgreSQL, Sybase ASE, Sybase SQL Anywhere, SQLite, and more.
Migration project management - allows migrations to be configured, copied, edited, executed and scheduled.
Source and Target selection - allows users to define specific data sources and to analyze source data in advance of the migration.
Object migration - allows users to select objects to migrate, assign source to target mappings where needed, edit migration scripts and create the target schema.
Data migration - allows users to map source and target data and data types, set up data transfer and assign post data transfer events where needed.
Version Upgrades - using migration users can easily move databases off older MySQL versions to the latest.

Copy Database Structure From MS SQL 2005 to MySQL 5.1

I want to Replicate a database without data (Only the structure) with stored procedures from MS Sql Server 2005 to My SQL 5.1. Is there an easy way of doing this.
I have Installed the MySQL Workbench 5.2
In SQL Server Management Studio you can right click on a database and go to Tasks->Generate Scripts...
Then you can basically go through generating the SQL queries that will work in MySQL
My first thought would be to not include any indexes, constraints or foreign key stuff in the queries, as MySQL handles these quite differently to SQL Server.
Just practice a few times and note down what causes errors when you use the queries in MySQL.
Using the knowledge of how MySQL handles your database objects you can try and create stored procedures that generate the queries that will create these objects on MySQL and then execute them against the MySQL database.
EDIT :
Ok so you want to move stored procedures over from SQL Server to MySQL. This is a fairly tricky thing to do if the stored procs are complicated.
Here is the basic overview I suggest you read before asking more specific questions about your problems.
http://dev.mysql.com/tech-resources/articles/migrating-from-microsoft.html
My advice is you read this and then try and migrate your stored procs and if you get errors, come back and ask specific questions about them.

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.