2

Is there any way to run Magento 2 setup scripts without bin/magento setup:upgrade

5
  • 2
    you can create your own command that does it, but what's the point? Maybe you should describe the problem you have – Marius May 16 '18 at 6:57
  • What you intend to achieve and why not to try upgrade command? – Jarnail S May 16 '18 at 7:19
  • @Marius @Jai, I know we can use upgrade to run our setup scripts, I just want to know is there a way to run externally. If we run setup:upgrade , again we may have to do di:compile or content:deploy in order to get site up. – Mahendra Jella May 16 '18 at 7:27
  • I still didnt get why you need to do this? Do you want a single command to execute all ? – Jarnail S May 16 '18 at 7:31
  • No, I want to run particular setup script file externally. – Mahendra Jella May 16 '18 at 7:34
3

Look at file: vendor/magento/magento2-base/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php

In execute method, you can find all functions, which are firing on setup:upgrade.

Part you want is:

$installer->installSchema();
$installer->installDataFixtures();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.