Migrate old application to Yii 2.0

Hello guys.

I’m in the middle of evaluating some options to move our legacy application written in old OOP PHP to something more… modern!

The application is a mix of old classes that do lots of things and scripts that handle some logic and html. A coders nightmare. But time is scarce and we need to release in certain time periods.

What I want to know is how or if its possible to have my legacy application side by side with Yii 2.0 and gradually move functionality from old(legacy application) to new(Yii 2.0) application. Due to my time restriction and release cycle I would like to port functionality step by step.

I understand that some have done this but how would I approach this with as little effect on my legacy application as possible? Its quite the delicate application.

Tips, thought, discussions, im grateful for all info I can get.

Best regards,


Hi, some quick thoughts…

If your app follows a well implemented M.V.C pattern you would at least have to :

  • create controllers

  • create actions to get logic from existent code

  • adapt views

to get something functional.

But you still will have to create models (and rewrite actions), components, widgets, partial views…

From a nightmare to another I think.

Maybe you should first try building a new yii2 project from scratch and tell your web server which

app to use depending on the url. Taking care of sessions and customizing yii UrlManager should do the trick.

Good luck.


Haha, good sir, you are living in a another decade than my application that I maintain. I’m talking about procedural PHP code with some objectified logic with no pattern whatsoever… But thanks for the tip. :)

Best regards,


Does your app use a database?

You can import your tables with gii and create models an relations from an existing database to have a starting point…

A basic gui can also be created with gii.

Indeed, that would help Yiim, thanks for the tip.

But until I have migrated over all the tables and such, is it possible to integrate my old application to go thru yii but still keep the old functionality and paths so my old application would work as it was with the "old setup"?

Best regards,