Reverse engineering Database using Models

Something bad happened to my server and all my databases are lost. I never kept any backups for the database and now I am strangled. I was checking if there is any extension or plugin that I can use via GII to recreate migration files for tables using references from Models.

Oh, that’s too bad. I’m very sorry for your situation.

I’ve never heard of such extension or plugin.

Do you have the source codes of the Models? And is it you that wrote them?

Look on GitHub - Insolita/yii2-migrik: Yii2 Gii-tools for create migration files As stated in readme

[…] generate migrations based on PHPDOC and model properties

Hope it will help you.

1 Like

Yes sir, I used Gii to create most of them and worked around accordingly. The DB is something I can put the time in and recreate but the relationship would be all messedup as I don’t have proper documentation of the code/application.

I’ll give it a go. Thank you