We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

How can I migrate in a production environment ?

Hello everyone,, How can I migrate in a production environment ?

I wanna migrate production by using phalcon learners test nsw. but we should not use development tools in production environment.

now I use this command in local environment.

phalcon migration --verbose --action=run Is there ways of migrating without using phacon-devtools in production environment??



3.6k

The team I'm working with was wondering the same thing. Our phalcon project is not live yet, but I did come up with an idea.

Have the deployment server run the phalcon migration run against the production database.

In most cases, it would be good to run backwards compatible migrations before deploying the actual code.

you can use a single test environment to mimic the production environment

edited Oct '19

Hello, I was about to post the same question.

As implicitely stated on the documentation page ("installing-via-composer"), the devtools is a development tools and it shouldn't be deployed on production (via composer : in "require-dev" section and not in "require"). That makes much sense since no one wants to scaffold an app after it has been deployed. Or, even without calling non migration commands, having unnecessary scripts wandering around.

But, the migration system is indeed required. As such a migration system is primarly aimed at working with actual data, keeping them safe during the process.

The question is then : how this dilemna can be resolved ? Being able to run the migrations generated through the Devtools without installing the whole thing. Or I may be missing something ? Any example on how you guys did on your projets would be helpful.

PS : that thread might be categorized under "Developer Tools". PS2 : other thread one the same subject, no solution given.

Now there are many interesting opportunities.

For v4 Migrations logic was separated into own repository. We are working at standalone migrations package to make it easier to do on production env.

https://github.com/phalcon/migrations

If you have any questions, ideas or feature requests, please submit an issue on link above.

edited Aug '20

For v4 Migrations logic was separated into own repository. We are working at standalone migrations package to make it easier to do on production env.

https://github.com/phalcon/migrations/

If you have any questions, ideas or feature requests, please submit an issue on link above.

Thank you very much for your hard work.

Yea but zephir isn't always 1:1 to personal home page, a few things may go differently and some insects that could exists cannot exist in Hypertext Preprocessor. You ought to upload all assessments from phalcon to be honest if you need this to have any sense. But nonetheless, why not have higher performance also while growing? You can see detail of NWS https://forum.phalcon.io/discussion/20029/phalcon-framework-written-in-language-php