Tuesday, September 20, 2005 MSSQL 2 MySQL

Changing our web servers from Windows and IIS to Linux and Apache has been a fun and educational process. We're already experiencing a better return on our investment and things are running much smoother. A few things in the transition, however, have required a bit of work and research.

ColdFusion on Linux cannot use the old Microsoft Access databases we were using previously, and one of our larger Access applications had to be converted to a Microsoft SQL Server database.

For the security of the SQL Server, we didn't want the Web servers to be able to access it, so to pull reports and show data from it, we decided to duplicate the data on the web server itself.

There are a few scripts and programs that will convert a Microsoft SQL Server database to MySQL, however, none were set to run quickly, easily, and automatically. So I created my own.

Using Michael Kofler's mssql2mysql script (released under GPL) as a starting point, I modified and built an simple Visual Basic application that would be able to run as a scheduled task on the SQL Server box and copy the data to the web server. All the user has to do is change some settings in an INI file, and run the program.

The executable, which is quite small (56kB), as well as the full project source code, is available here for download under the GPL.

Requirements:

  • Visual Basic 6 runtime libraries, which come with WindowsXP and Server2003
  • SQL-DMO, which comes with SQL Server or the freely available MSDE
  • Microsoft Data Access Components v2.7 or above, freely available from the Microsoft web site
  • Connector/ODBC, freely available from the MySQL site

MS2MySQL v1.0 (30kB)