Table of Contents
- Overview
- Need More Detail?
- How to Get Magento Patches
- How to Apply a Magento Patch
- How to Revert a Magento Patch
- Troubleshooting
Overview
This article discusses how to apply and revert Magento patches you get in any of the following ways:
- Magento Support
- Magento Enterprise Edition (EE) support portal
- (Magento partners) from the partner portal
If you don't already have a patch, contact Magento Support.

.sh
. If your patch file name ends in .patch
or something else, contact Magento Support before proceeding.Need More Detail?
For more step-by-step details that are provided here, see one of the following:
How to Get Magento Patches
Magento Support provides some patches for Magento CE and EE on magentocommerce.com. This section discusses how to get those patches.
If Magento Support provided a patch to you, skip this section and continue with How to Apply a Magento Patch.
See one of the following sections for specific information about Magento CE or EE:
Getting Magento CE Patches
To get patches for Magento CE:
- Log in to magentocommerce.com/download.
(Click My Account in the upper right corner of the page.)
If you don't have an account, you can register for one; the account is free. - In the Magento Community Edition Patches section, locate the patch to install.
- From the list next to the patch, choose your CE version.
- Click Download.
- After the patch downloads, continue with How to Apply a Magento Patch.
Getting Magento EE Patches
To get patches for Magento EE:
- Log in to magentocommerce.com.
(Click My Account in the upper right corner of the page.) - Click Downloads in the left pane.
- Click Magento Enterprise Edition in the right pane.
The following figure shows an example. - Click Support Patches.
- Locate the patch to download.
- Click Download corresponding to the patch for the version of EE you're using.
- After the download completes, continue with the next section.
How to Apply a Magento Patch
To apply a Magento patch:
- Transfer the patch
.sh
file to your Magento installation root directory.
For example,Note: This article assumes your patch file name ends in
.sh
. If your patch file name ends in.patch
or something else, contact Magento Support before proceeding./var/www/html/magento
. - Enter the following command as a user with sufficient privileges to write to Magento files (typically, the web server user or
root
):sh patch-file-name.sh
A message such as the following displays to confirm the patch installed successfully:Patch was applied/reverted successfully.
- To reapply ownership to the files changed by the patch:
- Find the web server user:
ps -o "user group command" -C httpd,apache2
The value in the USER column is the web server user name.
Typically, the Apache web server user on CentOS isapache
and the Apache web server user on Ubuntu iswww-data
. - As a user with
root
privileges, enter the following command from the Magento installation directory:chown -R web-server-user-name .
For example, on Ubuntu where Apache usually runs aswww-data
, enterchown -R www-data .
- Find the web server user:
- Perform any other tasks as instructed by Magento Support.
(For example, some patches require you to stop external services, such as the Solr search engine.)
Reverting the Patch
If applying the patch results in errors, contact Magento Support. If you are instructed to do so, revert the patch:
- Change to your Magento installation directory.
- Enter the following command as a user with sufficient privileges to write to Magento files (typically, the web server user or
root
):
sh patch-file-name.sh -R
Troubleshooting
If you get an error when you run the patch, use the following suggestions:
- Verify the patch is located in your Magento installation root directory.
Ubuntu example:/var/www/magento
CentOS example:/var/www/html/magento
- Verify you're running the patch with sufficient privileges.
Typically, this means running it as the web server user or as a user withroot
privileges. - Try running the patch again.
If problems persist, contact Magento Support.