How to upgrade Magento version

Good day to Amasty blog readers! Today I’m speaking on a topic our team had many requests for: how to upgrade your Magento store correctly?

We have been talking about the importance of upgrading software a lot; it is crucial both for your server software and your Magento installation. Regular updates bring you not only the new features, but also security fixes, which is highly important for your Magento store’s safety.

Say, you see that your Magento version needs an upgrade. It’s hard to guess which version you have now, but we hope it’s 1.4.2.0 at least.

1. Prepare for Magento upgrade

To make the process more vivid we installed a shop on Magento 1.4.2.0 with sample data and we are going to upgrade it to 1.9.1.0, which is the latest stable Magento version as of this writing.

The website is installed into /home/mgtest/public_html, the database is on localhost and is called mgtest_magento. So if you use the instructions from this article, make sure you replace these values with your own ones.

2. Full Magento backup

This rule refers not only to upgrading Magento, but to any serious changes you’re going to apply on your website.

Backup your Magento store!

This is an essential procedure which saves you from unsuccessful updates, site breakdowns, data loss and makes sure the update won’t drive you up the wall.

The simplest variant of Magento backup can be implemented using these two commands:

3. Check system requirements

Check if your server suits minimum system requirements of the Magento version you’re upgrading to. You may want to have a look at the PHP version (5.4.x or 5.5.x is needed) and memory_limit value in php.ini in the first place.

4. Create a sandbox

Never ever update the primary website if you’re not 100% sure everything’s go. If you don’t test the update on a sandbox you won’t know if the website is going to work after the update and how much time the upgrading process will take.

Your store’s upgrade may require up to several hours, and there’s no point in shutting the primary e-shop down for the whole working day just to find out that the upgrade went wrong, the time’s lost and all you have to do is to restore the website from a backup copy. Also, remember that recovering from a backup copy takes more time than backing up itself, so count this time in.

To check if the update is going to run smoothly, let’s make a sandbox which we’re going to upgrade first. We have created an empty mgtest_staging database beforehand.

To finish the upgrade open the home page so Magento updates the database. This process can be lengthy, so consider doing it with the following command:

cd /home/mgtest/public_html/staging
php -f index.php

6. Test, test, test

Carefully check how your website is working. Go to Magento logs at /home/mgtest/public_html/staging/var/log and to web server logs at /var/log/httpd, /var/log/apache2 or /var/log/nginx depending on the distribution kit and the web server you use. Carefully look through the logs to catch any possible errors.

Note: please make sure that you carefully test the performance of your extensions. If you upgrade to the latest and fresh version of Magento, the chance some extensions will work with errors or conflict with each other is rising, because not all Magento extensions providers test their modules right away after the release.

7. Primary Magento upgrade

If the careful research and testing didn’t reveal any malfunctions or you have found how to fix the errors, now it’s time to update the primary website. As the process of upgrade and testing takes certain time, make a fresh backup copy of the primary website, because you don’t want to recover from an old backup copy and lose the latest changes. Before backing up switch your website to maintenance mode and disable cron.

We do not recommend replacing the primary website with the sandbox store, as in that case you’re in risk of losing the data that was changed or added while testing.

Done! The last part is to turn the maintenance mode off and enable cron:

rm /home/mgtest/public_html/maintenance.flag
crontab -u mgtest –e

Mission completed! Now your shop is updated to the latest stable Magento version.

Do you have any questions on Magento upgrade process? Welcome to the comments section.

Update: right now the instruction isn’t working because the http://connect20.magentocommerce.com/community link isn’t working and we couldn’t find the replacement of it in Magento docs. As soon as we find one, we’ll update the article.

About The Author

Andrei believes that only at work people can fully express themselves, so he does his best to implement all his knowledge while in the office. Having made computer science his hobby, Andrei is constantly developing his professional skills. But despite such a busy schedule he always finds time to read science fiction books and communicate with new interesting people.

Hi Ron!
Thanks for your question, great you decided to upgrade your Magento store.
Could you please drop a line about your request to our support here? https://amasty.com/contacts/
Our support managers will give you the necessary information according your case. Thanks in advance!

Reply

3 years ago

Hiren Modi

Wow this is really great post. i was just looking for such content on the web for my website magento version up gradation.

Reply

3 years ago

Ksenia Dobreva

Thanks, Hiren! Glad it worked for you.

Reply

3 years ago

James

Hi My website has alot of custom code/design changes which I have made personally, so my upgrade process isnt as simple as yours ( I can’t simple install the latest version into my live), what I have done so far is installed a fresh copy of the latest version of Magento 1.9.1 on a sub-domain of my live site and hid from web crawlers/bots etc. I have imported my live DB into the new test DB, so I have the correct content to work with. I have then spent a good week or more editing the new RWD template to… Read more »

Reply

3 years ago

Ksenia Dobreva

Hi James,

we would suggest the following:

1) shutdown live site (you can use Magento maintenance mode)
2) backup live site sources and database!
3) copy subdomain sources and database to live site sources/database (old sources should be deleted)

But these steps do not cover the difference between the live and the test site which occurred while you were tweaking your test site. So you’ll need to transfer some data from the old installation to the new one.

Hope that helps!

Reply

3 years ago

MagePsycho

I have always used .diff patches in order to upgrade magento and have been successful.
Of course you have to apply the incremental version patches, for example: 1.7.0.0 to 1.7.0.1, 1.7.0.1 to 1.7.0.2, and so on.
This may take a bit more time but the error you will have is minimum than direct upgrade from minor to major version.

Reply

3 years ago

Ksenia Dobreva

Thanks for sharing your experience!

Reply

3 years ago

Mubashar Aftab

Why

mv public_html public_html-BAK

and not

cp public_html public_html-BAK

Reply

3 years ago

Ksenia Dobreva

Hey Mubashar, thanks for asking.
Because this particular command is for data recovery, not backup.

I am Hans Ni from Woodeko company. We know that your company specialized in Magento.
Now we met with Magento problem. Our http://www.woodeko.com is offline just because its low version. Can you help us to make it online. Perhaps you make it online by upgrading its version. We can pay some money to your for your great service.

Our current version of Magento is 1.5.0.1, can you upgrade it to a new version that makes it online.

Reply

3 years ago

Ksenia Dobreva

Hey there and thanks for your interest and trust!
Unfortunately, we don’t offer Magento upgrading services right now. Wish you good luck with upgrading your store!

Reply

3 years ago

Melanie Johnson

Good solution to upgrade magento 1.9. Is this magento upgrade suitable for Magento 2 in 2016? It is as same as Magento upgrade extension of Litextension.