I have a few websites using Active Server Pages and Microsoft SQL Server for the database running on a Win2K server. I am considering converting some or all of them to use PHP and MySql on a Linux server instead. My reasons for wanting to do this would be:
- better security
- more stability & scalability
- less expensive
- open-source
- many more hosting options with linux
- to get more experience with PHP and MySql (don't have much now but I'm sure I can pick them up pretty easily)
First, I'd like to know whether my reasons above seem like good and correct ones.
Next, I'm wondering what the best approach to making the conversion would be. Due to time limitations, and the desire to minimize any downtime, I may not want to convert everything at once, but rather do it piecemeal. Would it be better to:
- First convert the database to MySql, then convert scripts to PHP, then move to Linux server
or
- First convert scripts to PHP, then convert database to MySQL, then move to Linux
or
- Build everything again from scratch on the Linux server.
If I pursue option (1) above, I'm assuming I'd need to find an ODBC driver for MySQL. Are there ones available?
If I pursue option (2) above, I'd need to find some kind of way to connect to the MS-SQL Server database from a PHP script. Is this possible, keeping in mind that the PHP will be executing on a Win2K server initially, not a Linux server. I'd also want to try to minimize the code changes, maybe by finding or creating a class that can handle connections to either a MySQL database or a MS-SQL database using the same interface.
Another question I have, are there things I need to look out for when converting from MS-SQL to MySQL? Any tools that can easily handle exporting the table scructures and data?
Any helpful ideas or advice would be appreciated, especially from anyone who has had similar experience.