Solved

SQL sever 2008r2 DB migration to MySql engine.

Posted on 2012-04-04
3
257 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now