We have an application written in MS-SQL/ASP.Net. It has been suggested to "re-code" the front-end in PHP and migrate from MS-SQL to MySQL. When we wrote the application MySQL did not provide for stored procedures, triggers etc and we use these to track changes to the data, yet we've been told these are now available in MySQL.
Is it possible to convert MS-SQL/ASP.Net to MySQL/PHP in a simple automated manner, that is, are there tools that can convert the code? Furthermore, can a PHP front-end be used with a MS-SQL back-end?
We are receiving a lot of conflicting information at the moment from ASP.NET, MySQL, MS-SQL and PHP coders.
Migrating from MS-SQL/ASP.Net to MySQL/PHP
Moderator: General Moderators
-
Thick Beagle
- Forum Newbie
- Posts: 2
- Joined: Sat Apr 11, 2009 10:35 pm
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Migrating from MS-SQL/ASP.Net to MySQL/PHP
I guess the first question I would have is why and who suggests you ""re-code" the front-end in PHP and migrate from MS-SQL to MySQL." ? There may be valid reasons to do that. And since this is a PHP forum you will generally get a pro-PHP attitude. But the reality is that well designed and implemented applications can be built in any of today's popular languages. What your developers have the most experience with is probably the main reason for choosing a language. The other main reason to choose PHP/MySQL specifically is that those technologies are probably the most widely available from hosting companies. That give you a lot of choices in host and configurations. It also means that there are many application, libraries and support (like this forum). But many other technologies, such as ASP.Net, Java, Ruby or Python, also provide good development solutions.
In answer to some of your specific questions:
- You can easily connect PHP to a MSSQL database. PHP is database agnostic and supports many databases. You can even easily use several different databases in one application.
- I would recommend rewriting the application in PHP rather than attempting to try some sort of porting tool. There are just some different basic assumptions between ASP.Net and PHP applications.
In answer to some of your specific questions:
- You can easily connect PHP to a MSSQL database. PHP is database agnostic and supports many databases. You can even easily use several different databases in one application.
- I would recommend rewriting the application in PHP rather than attempting to try some sort of porting tool. There are just some different basic assumptions between ASP.Net and PHP applications.
(#10850)
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Migrating from MS-SQL/ASP.Net to MySQL/PHP
There are clear advantages to switching to MySQL and PHP -- the biggest being they are essentially free technologies.
Secondly switching to PHP almost always justifies switching to MySQL and the two technologies play best togather. When you use MSSQL you have two options:
1. Have a Linux box running the PHP/Apache and a Windows box running MSSQL and connect using ODBC -- overkill in many situation
2. Have PHP running under windows and connect using the native mssql_* API using a single machine again
MSSQL (prior to 2005?) had no LIMIT like clause which made paginating resultsets required up to three sub-selects whereas this is effectively/easily done in MySQL using a single SELECT with the LIMIT clause.
I believe that for historical reasons (MSSQL being used in desktop apps) a LIMIT like function wasn't really required...only after feeling the pinch from MySQL developers complaining about the lack of simple pagination (which is more common/required in web based apps) they implemented something similar but it's not called LIMIT -- the keyword escapes me at the moment.
MySQL 5 I beliebe supports most enterprise features (stored procs, views, triggers, etc). That should be easy enough to figure out though just read the docs.
About the only *real* advantage developers have when using ASP.NET is the IDE support is second to none -- nothing comes close in open source even with Zend Studio and Framework gaining some traction/control.
Micrsoft builds nice IDE's and makes a lot of manual work disappear.
If you have the time/budget and are looking long term -- then a rewrite to use LAMP is probably a good idea. You have more developers and open source code at your disposal and cheaper developers to boot (supply and deman, right).
Cheers,
Alex
Secondly switching to PHP almost always justifies switching to MySQL and the two technologies play best togather. When you use MSSQL you have two options:
1. Have a Linux box running the PHP/Apache and a Windows box running MSSQL and connect using ODBC -- overkill in many situation
2. Have PHP running under windows and connect using the native mssql_* API using a single machine again
MSSQL (prior to 2005?) had no LIMIT like clause which made paginating resultsets required up to three sub-selects whereas this is effectively/easily done in MySQL using a single SELECT with the LIMIT clause.
I believe that for historical reasons (MSSQL being used in desktop apps) a LIMIT like function wasn't really required...only after feeling the pinch from MySQL developers complaining about the lack of simple pagination (which is more common/required in web based apps) they implemented something similar but it's not called LIMIT -- the keyword escapes me at the moment.
MySQL 5 I beliebe supports most enterprise features (stored procs, views, triggers, etc). That should be easy enough to figure out though just read the docs.
About the only *real* advantage developers have when using ASP.NET is the IDE support is second to none -- nothing comes close in open source even with Zend Studio and Framework gaining some traction/control.
Micrsoft builds nice IDE's and makes a lot of manual work disappear.
If you have the time/budget and are looking long term -- then a rewrite to use LAMP is probably a good idea. You have more developers and open source code at your disposal and cheaper developers to boot (supply and deman, right).
Cheers,
Alex
Re: Migrating from MS-SQL/ASP.Net to MySQL/PHP
After working long years with .NET, I mostly switched to PHP/mySql. I'd say that automatic conversion is NOT possible due to the way the code and classes are organized in .NET. Don't even think about that.
Try to make step by step switch (I was just thinking in making sample application PHP to MS Sql but no ODBC – it's slow):
- connect directly to PHP (there are some solutions around that should be tested first)
- you make a web service (.NET) as MS Sql data provider and PHP service connector on the other side (this is sometimes used as core architecture in .NET, it has disadvantages, but serves the purpose-> this can be done in secure way
Rewriting web application can take time... So you might think on connecting .NET to mySql first.
A valid reason to do this conversion should be required future upgrades to the system, company IT environment etc. Lots of them, but requires a good planing.
PHP was made for web!
Cheers, Gregor
Try to make step by step switch (I was just thinking in making sample application PHP to MS Sql but no ODBC – it's slow):
- connect directly to PHP (there are some solutions around that should be tested first)
- you make a web service (.NET) as MS Sql data provider and PHP service connector on the other side (this is sometimes used as core architecture in .NET, it has disadvantages, but serves the purpose-> this can be done in secure way
Rewriting web application can take time... So you might think on connecting .NET to mySql first.
A valid reason to do this conversion should be required future upgrades to the system, company IT environment etc. Lots of them, but requires a good planing.
PHP was made for web!
Cheers, Gregor
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
-
Thick Beagle
- Forum Newbie
- Posts: 2
- Joined: Sat Apr 11, 2009 10:35 pm
Re: Migrating from MS-SQL/ASP.Net to MySQL/PHP
Thanks for all the comments.
I've been thinking about the migration, and I think it will be a two-step process. Firstly, convert the MS-SQL database to a MySQL database. Then, re-work the required interface from .Net to PHP.
Anything to watch out for with this?
I've been thinking about the migration, and I think it will be a two-step process. Firstly, convert the MS-SQL database to a MySQL database. Then, re-work the required interface from .Net to PHP.
Anything to watch out for with this?