views:

168

answers:

2

I have a completed web app in PHP 5 + MySQL. I have not yet started its conversion, but it will migrate to ASP.NET MVC + MS SQL 2008. I'm not sure how to progress for the easiest transition:

  1. Edit the PHP DAL for SQL Server. Migrate to the new db immediately
  2. Leave the live code alone. Create ASP.NET MVC with a MySQL DAL to use for now. Migrate to new db later
  3. Leave the live code alone. Write the new version entirely. Transition db and code at the same time

Is there some common wisdom for which path is best to take?


Edit: addressing Dave's question:

How are you accessing the database? If you have really good separation between your code and database and are using stored procedures it would probably affect the answers given.

None of the ASP.NET MVC stuff has been written at all. There will have to be some changes to make the current PHP data layer work with MS SQL. I'm currently taking advantage of some PHP+MySQL stuff that doesn't exist with PHP+MSSQL. Nothing major but it will take some amount of retooling. My data layer is sufficiently separate that I hope it won't be too invasive.

Also what's your release plan? Will you be forced to release incrementally or do you plan on just "flipping the switch" one day?

Flipping the switch -- it's just a hobby site for my family. But I'm not opposed to leaving 1 db and both code sets live for a while until I feel confident that the new one is fine.


Edit 2:

Looks like my options are limited more than I thought. You can only use PHP's native MSSQL functions for SQL 2000 and before. For 2005+ you need to install MS provided drivers. I'm on el cheapo shared hosting so I can't really ask them to install drivers for me. Looks like I unfortunately have my answer :(

+1  A: 

The purists will suggest starting with TDD so you can have a gauge of when the migration is fairly complete by having all unit tests pass.

However, I would suggest that you start with the app from scratch in ASP.NET MVC as it's very different from a non-MVC PHP application. I'd map the data layer first and build some models then work my way up controllers and the view. The data models should be fairly easy to migrate if you use the visual studio surface designer.

aleemb
A: 

An easy way would be to use an Application generator.

There are many available like:
- Iron Speed Designer (only supports ASP.NET)
- Code Charge Studio (supports many different web scripting languages like PHP, ASP, ASP.NET, Pearl, etc.)

I have tried out both. But have not been satisfied with any as they have not documented the MVC/MVP part to extent that it becomes easy for developers to modify generated code.

Iron Speeds Designer MVC is better compared to CCS but ISD will prove to be costly as it supports only one set of technology while CCS supports many and one can add support for new language with a little support from its developers.

Yogi Yang 007