Patching Magento: How-To Guide

While the fine folks over at Magento work tirelessly to improve Magento, part of that process is discovering critical bugs and, subsequently, creating patches to fix them. Applying these patches can be a daunting task for those of us who do not have access to a developer. We have developed this how-to guide to be lightweight and straight to the point.

If you experience any hangups along the way, remember that our support staff is here 24/7/365 to assist you. Let’s get started!

Make a copy of your live environment for testing. Better to be safe than sorry!

1. Backup your Magento files and database.

mysqldump -u USER -p DATABASE | gzip > DATABASE.sql.gz
mysqldump -u USER -p DATABASE | gzip > DATABASE.sql.gz

2. Determine your Magento version.

grep -A6 'public static function getVersionInfo' public_html/app/Mage.php

3. Verify if the directory downloader exists in your Magento root. Replace the downloader if missing.

4. Download the appropriate patch based on the installed Magento version, and upload the patch to your Magento root. (i.e., /home/USER/public_html)

https://www.magentocommerce.com/download

supedown 01 patching magento

 

5. Disable the Magento Compiler.

php shell/compiler.php disable

6. Clear compiled files from the Magento Compiler.

php shell/compiler.php clear

7. Run the patch in your Magento root. (i.e., /home/USER/public_html)

bash PATCH.sh

8. “Patch was applied/reverted successfully” indicates that the patch installed.

9. In your Magento root, flush the cache. (WARNING: Be extremely careful when using the below command, you risk data loss otherwise.)

rm -rf var/cache/*

10. Flush the Redis cache.

redis-cli flushall

Lastly, perform a visual inspection of your store to ensure everything is in working order. If you need assistance, open a support ticket.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top

We can help you. Right now.

Fast growing merchants depend ServerGuy for high-performance hosting. Experience counts. Let's get started.

Talk to a sales representative

USA / Worldwide

+1.714.2425683

India

+91.9852704704