Magento is a flexible, customizable open-source platform that has a huge number of inbuilt functionalities. Apart from having these advantages of open-source software, Magento has some drawbacks related to security threats and vulnerabilities. To resolve these threats Magento releases security patches from time to time.
Security patches contain security fixes only. They are designed to make the upgrade process faster and easier. There are two ways to apply a security patch in Magento using:
- Command Line
- Composer
Follow the below steps to apply security patches using Composer:
- Enable Maintenance Mode: It will prevent from customers placing unfulfillable orders.
php bin/magento maintenance:enable
- Check running Cron Jobs: Wait for the currently working cron jobs. Once they are completed, turn off the services.
- Execute Composer Command: Security patches use the Composer naming convention
2.3.3-px
. Use Composer to specify a patch.composer require magento/product-community-edition=2.3.3-p1 --no-update
- Apply updates: This will update changes from the composer.json file.
composer update
- Clean the Magento cache:
php bin/magento cache:flush
- Clear the
var/
andgenerated/
subdirectories:rm -rf generated/* var/cache/* var/page_cache/*
- Update the database schema and data:
php bin/magento setup:upgarde
- Disable maintenance mode:
php bin/magento maintenance:disable
- (Optional) Restart Varnish:
service varnish restart
Comments
Post a Comment