Apply individual patches

WARNING
It is a best practice to test all patches in a staging or development environment before deploying to production. It is also recommended to back up your data before applying a patch. See Backup and rollback the file system, media, and database.

To apply a single patch, run the following command where MAGETWO-XXXX is the patch ID specified in the status table:

./vendor/bin/magento-patches apply MAGETWO-XXXX

You can also apply several patches at the same time by separating each additional patch ID with a space:

./vendor/bin/magento-patches apply MAGETWO-XXXX MAGETWO-YYYY

You must clean the cache after applying patches to see changes in the Adobe Commerce application:

./bin/magento cache:clean
INFO
Consider keeping a list of applied patches in a separate location. You might need to re-apply some of them after upgrading to a new version of Adobe Commerce. See Re-apply patches after an upgrade.

Revert individual patches

WARNING
It is a best practice to test all patches in a staging or development environment before deploying to production. It is also recommended to back up your data before applying a patch. See Backup and rollback the file system, media, and database.

To revert a single patch, run the following command where MAGETWO-XXXX is the patch ID specified in the status table:

./vendor/bin/magento-patches revert MAGETWO-XXXX

Also, you can revert several patches at the same time by separating each additional patch ID with a space:

./vendor/bin/magento-patches revert MAGETWO-XXXX MAGETWO-YYYY

To revert all applied patches:

./vendor/bin/magento-patches revert --all

You must clean the cache after reverting patches to see changes in the Adobe Commerce application:

./bin/magento cache:clean

Get updates

Adobe Commerce periodically releases new individual patches. You must update the Quality Patches Tool to get new individual patches:

composer update magento/quality-patches

View the added patches:

TIP
New add patches display at the bottom of the table.
./vendor/bin/magento-patches status

Re-apply patches after an upgrade

When you upgrade to a new version of Adobe Commerce, you must re-apply patches if the patches are not included in the new version.

To re-apply patches:

  1. Update the Quality Patches Tool:

    composer update magento/quality-patches.
    
  2. Open the list of previously applied patches, which was recommended in Apply individual patches.

  3. Apply the patches:

    ./vendor/bin/magento-patches apply MAGETWO-XXXX
    

    The best practice is to apply patches one at a time.

  4. Clean the cache:

    ./bin/magento cache:clean
    
    INFO
    When you run the status command, the patches that were included in the new version are no longer displayed in the table of available patches.

Logging

The Quality Patches Tool logs all operations in the <Magento_root>/var/log/patch.log file.

Previous pageQuality Patches Tool: A self-service tool for quality patches
Next pageRelease notes

Commerce