• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

SQL sever 2008r2 DB migration to MySql engine.

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
noamco36
Asked:
noamco36
  • 2
2 Solutions
 
Patrick TallaricoCommented:
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
 
noamco36Author Commented:
"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
 
Patrick TallaricoCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now