Advises on migrating from basic to advanced


I started a project with the basic app template, but I’d like to now go for an advanced template.

I’d like to get advises on how to proceed efficiently. (I haven’t done any test, I’m just in a planning stage.)

First: Can I just copy composer.json over and do a simple update?

Second, I’ll migrate most models in common. I “guess” that a simple global substitute from app\models to common\models will do.

Third, will there be more than adjusting a few module paths here and there to go to the front/back end?

What else? What do I forget?

Thank you for sharing your experience if you already went through this.

Yii often and prosper.

May I suggest that you create an advanced application from scratch, configure it and make sure that everything works as you want it to, before copying the models and modules over?

That way you’d get the feel of the advanced app before you start porting.

That includes pointing the web server to the correct places for the frontend and for the backend, checking that session cookies are handled (and separate) for the two ‘ends’.


You’re right.

I did it step by step and it was easy.

I started from a clean, new install. Simply copied composer.json and composer updated.

After each step, or major adjustment, I checked that the system was still running.

Migrating models, controller, etc. was really easy. Only namespace changes.

The longest part was moving config and splitting it between front/back or common.

Same with some objects like widgets and assets that needed to sometimes (hopefully temporary) duplicate in both front/back.

In about 2 hours, I got the system running. I have to confess that most of the dev was in backend, very little in frontend.