Copy projects

I am still learning about yii2.

One thing that I cannot understand is, in yii1, usually I just copy from old project when making a new project. remove unnecessary files and start the development.

in yii2, I cannot do so.

  1. Copy from old project the whole directory

  2. change the database connection on main-local.php

  3. run php init

But why, I still got connection to old database?

Can someone help?

TIA

Daniel

From your question, it appears that you are using the advanced template.

When you run init: Do you choose ‘Production’ or ‘Development’?

Do you overwtite the config files?

What is in your ‘environment’ directory config files?

From another of my post:

Maybe this will help.

yes, to be complete, I am using kartik practical a which based on kartik practical which is based on advanced template.

I run init and choose development.

I do not override config files, since I did it manually before running php init.

I never touch environment folder