We use cookies to understand how you interact with our site, to personalize and streamline your experience, and to tailor advertising. By continuing to use our site, you accept our use of cookies and accept our Privacy Policy.
Contact Us
Contact Us
Sign in
Sign in
Nexcess Logo

How to patch your Magento 1 store

September 10, 2019

Use this method with extreme caution unless you are a developer.

Caution

As a Magento store administrator, it is your responsibility to stay current on patch releases. We do not monitor our clients’ Magento versions or their patches, and we do generally do not notify our clients of new patches as they are released.

To stay current, we urge all clients to sign up for security alerts at the Magento website. In addition, watch for alerts posted within the Administrative area of your specific Magento installation or installations.

How to install patches

Apply Magento patches immediately upon release. Most releases address significant security threats. Ignoring them exposes your store and your customers to malicious activity. 

ATTENTION: We strongly recommend you enlist the services of a developer when applying patches. Some patches may affect your store in unpredictable ways or cause downtime. If you do not yet have a developer, consider starting your search with our list of Magento development partners.

 Read How to Improve the Security of Your Magento Store.

Step 1: Back up your store

ATTENTION: Always back up you store before installing a patch.

See How to back up your Magento 1 store.

Step 2: Download the patch

Visit the Resources page of the Magento website.

  1. Click RELEASE ARCHIVE.
  2. Locate your desired patch, select your format, and click DOWNLOAD. If you are unsure of which patch to download, scroll to the Version1.9.x section and download the first one.

    ATTENTION: Your most current version may vary from the one pictured below.

Step 3: Disable the compiler

The compiler is disabled by default. If you have not previously enabled the compiler, skip to Step 4. If you have previously enabled the compiler, or are unsure:

  1. From the Magento Admin panel, select System > Tools > Compilation.
  2. Choose the option that applies to you:

Step 4: Install the patch

Choose your method:

Method 1: Use SSH

ATTENTION: To use this method, you must first enable SSH on your account. See How to enable SSH for details.

Secure Shell (SSH) is the preferred method. This method assumes familiarity with SSH. For more detailed instructions about how to install a Magento patch with SSH, see the Magento website

  1. Upload the patch files to the root of your [magento] installation folder.

  2. Verify the compiler is disabled.

  3. In the console, run the following commands according to the patch extension, but replace patch_file_name with the actual file name:

    • .sh extension
      sh patch_file_name.sh


    • .patch extension
      patch --p0<patch_file_name.patch

  4. Confirm installation by running the patch file with the -list argument:
    sh patch_file_name.sh --list
    Your output will resemble:
    Your output will resemble:
     

Method 2: Run a script

  1. Upload the patch files to the root of your [magento] installation folder.

  2. Verify the compiler is disabled.

  3. Use a text editor to create a file named patch.php containing the following script, but replace patch_file_name with the actual file name:<?php
    print("<PRE>");
    passthru("/bin/bash patch_file_name.sh");
    print("</PRE>");
    echo "Done"; ?>


  4. Upload the patch.php file to the root of your [magento] installation folder.

  5. Run the script below, but replace yourstore.com with your domain name.
    http://www.yourstore.com/patch.php 
    
    If you see the message below, installation was successful:Checking if patch can be applied/reverted successfully... Patch was applied/reverted successfully. Done

  6. After installing the patch, delete the patch.php file from your server. If you encounter an error and are a Nexcess client, note the error and contact our support team.

  7. Refresh your cache from the Magento Admin panel by selecting System > Cache Management, then Flush Magento Cache.
  8. If your store is compiled, rerun the compiler. See Step 3: Disable the compiler for more information. 

Method 3: Patch files locally and upload

Although it is possible to download your site to your local machine, execute the patch, and then upload the patched files to your server, this method should only be attempted by experienced Magento developers.

For 24-hour assistance any day of the year, contact our support team by email or through your Client Portal.

Jason Dobry