Attention! This script is deprecated, we strongly recommend to use Magento 2 Zero Downtime Deployment Extension.
wget -O deploy.zip https://github.com/dndeus/magento2-zero-downtime-deploy/archive/master.zip
unzip deploy.zip
rm -f deploy.zip
mv magento2-zero-downtime-deploy-master/ deploy
cp deploy/app/static-content-deploy.sh.sample deploy/app/static-content-deploy.sh
cp app/etc/env.php deploy/app/env.php
echo $'\n'deploy/app/env.php >> .gitignore
chmod +x deploy/run
If you use specific static-content deploy commands then edit the file
deploy/app/static-content-deploy.sh
By default, it has commands to deploy all Magento 2 themes in en_US locale.
If you use Redis or other non-folder storage for session or cache, then edit the file
deploy/app/env.php
Make sure that the cache and session are stored in a folder.
To deploy Magento static content (bin/magento setup:static-content:deploy) with NO downtime, use the CLI command:
deploy/run -s
To generated code and dependency injection configuration (bin/magento setup:di:compile) with NO downtime, use the CLI command:
deploy/run -d
You can also run the script with multiple parameters, e.g:
deploy/run -d -s
To update Magento 2 modules database data and schema (bin/magento setup:upgrade), use the CLI command:
deploy/run
If you install new extensions then run this command:
deploy/run -m Vendor_Module1 Vendor_Module2
Note that these commands will also run DI and static content generation and this is the only command that put Magento 2 store into maintenance mode for a few seconds while setup:upgrade is running.
- Magento 2 Blog Extension
- Magento 2 Blog Plus Extension
- Magento 2 Blog Extra Extension
- Magento 2 Login As Customer Extension
- Magento 2 Convert Guest to Customer Extension
- Magento 2 Facebook Open Graph Extension
- Magento 2 Auto Currency Switcher Extension
- Magento 2 Auto Language Switcher Extension
- Magento 2 GeoIP Switcher Extension
- Magento 2 YouTube Widget Extension
- Magento 2 Product Widget Advanced Extension
- Magento 2 Conflict Detector Extension
- Magento 2 Lazy Load Extension
- Magento 2 Rocket JavaScript Extension
- Magento 2 CLI Extension
- Magento Twitter Cards Extension
- Magento 2 Mautic Integration Extension
- Magento 2 Alternate Hreflang Extension
- Magento 2 Better Order Grid Extension
- Magento 2 Admin Email Notifications