Solved

SQL sever 2008r2 DB migration to MySql engine.

Posted on 2012-04-04
3
280 Views
Last Modified: 2012-04-18
Hello:
I have a website that fetches info from SQL server db.
I want to move the current db that serves the website into MySql instead, and map the website to fetch the info from Mysql.

Which version of MySQL should I use?
What is the process for the migration?

Thanks you.
0
Comment
Question by:noamco36
  • 2
3 Comments
 
LVL 6

Assisted Solution

by:Patrick Tallarico
Patrick Tallarico earned 500 total points
ID: 37808939
This sounds like it could be quite involved depending upon the size of your databases and web site.
As far as the version of Mysql, I don't think there should be too much of an issue with just using the most recent version of the standard  community installation unless you need the cluster reliability.  
http://dev.mysql.com/downloads/mysql/

There is a Mysql migration tool you can use to help move the data from mssql to mysql.  
http://dev.mysql.com/doc/migration-toolkit/en/index.html

As far as the web site, what scripting language are you using?  I would hope that your database calls are referencing some sort of centralized function or class to make sifting through things a bit easier in terms of replacing the mssql requests with mysql requests.  If it is PHP, the mssql and mysql functions are close to identical, so the syntax will not need to be too difficult.
0
 

Author Comment

by:noamco36
ID: 37808990
"As far as the web site, what scripting language are you using?"  

All I know about the website is that they used WordPress framework to built it.

The size of the db is relatively small.
0
 
LVL 6

Accepted Solution

by:
Patrick Tallarico earned 500 total points
ID: 37809038
Wordpress generally uses PHP, and has it's own mysql database.  You could probably use that installation and just create a new database that mirrors the old ms sql one.  You could still use the mysql migration tool to move the data.  If it is small, then you will probably be able to look directly at the pages that are connecting to the mssql server using an adminstrator login. From there you could adjust the connection parameters for the database calls and you should be able to leave the queries the same for the most part.  

as an example here is the code for the mysql database connection.
http://php.net/manual/en/function.mysql-connect.php

and here is its mssql counterpart.
http://php.net/manual/en/function.mssql-connect.php

Generally the similarities should make this relatively simple if you are familiar with php, but it could be a bit daunting if you are not.

Also you may need to look at the queries that are being sent to the sql server. The query syntax for mssql and mysql differs a bit, so things like restricting output to a defined number of rows would need to be rewritten to match the mysql syntax.  Ex:

mssql:
select top 10 * from table

mysql:
select * from table limit 10

How many different pages do you currently have that request MS sql data?
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question