December 04, 2013

Upgrading to Magento

Magento Community Edition version was released on September 25, 2013. Its highlights, as listed in the release notes, include:

  • Major overhaul of tax calculation formulas, correction of rounding errors, and additional assistance with configuration.
  • Optimized cache adapters for single-server systems.
  • Upgraded Redis cache adapters for multi-server systems. (To set up and use Redis with Magento, please contact our support team and we can assist you. This can only be set up on SIP400 or higher plans.)
  • Eliminated many types of database deadlocks.

So far, upgrades from to have been very quick compared to other earlier upgrades and, for the most part, have gone smoothly (there have been a few minor issues I will highlight later). Upgrades from other Magento versions to do take longer (especially 1.5.x to 1.6.x) as they involve a large amount of database changes.

At Nexcess, we perform upgrades via the command line. It is goes more quickly and we can better see what is happening should anything go wrong. The following outlines two different methods to upgrade to the latest version of Magento (from version or later) using the command line tools.

Please note If you are on a version earlier than, you will need to first upgrade using the “pear” installer. For more on that, please see the post about Upgrading to Magento

First and foremost, before beginning using either method, always create a backup of both your database and files. It’s also highly recommend to first go through the upgrade process on a dev site (an exact copy of your live site using a copy of the database). That way you can work out any issues that come up, take note of them, and run the upgrade on the live site much more seamlessly.

Two other preliminary steps we recommend are: Switching caching storage to files in your Magento local.xml file and truncating logs tables in the Magento database (to make the database as lean and optimized as possible pre-upgrade).

Method 1: Upgrade using mage tool

With upgrades from, you can use the “mage” tool to upgrade. For help with specifics on the mage tool, you can always type “./mage help” to see a list of commands, and “./mage help command” to see help for a specific command.

  1. After you’ve created backups, first you initialize the new Magento Connect registry and channel:
  2. [code language=”bash”]./mage mage-setup .[/code]

  3. Next run the following to set preferred set to stable:
  4. [code language=”bash”]./mage config-set preferred_state stable[/code]

  5. Then you need to sync the old Magento Connect registry – the core and community extensions you already have – with the new 2.0 registry.
  6. [code language=”bash”]./mage sync[/code]

  7. You should hopefully see a list of all of your installed extensions, including your third-party extensions. As we move to the next step, note that the syntax we use will upgrade everything we have installed in the channel. So if your extension developer released a new version to match the new version of Magento, it will get upgraded as well. Also note that for some reason, we have to –force the upgrade, or else it won’t work.
  8. [code language=”bash”]./mage upgrade-all –force[/code]

  9. Once this is done, I highly recommend restricting access to your site to your own IP address. This is because that the first hit to your page will trigger the database upgrade. You want this process to go uninterrupted. You can do this in the .htaccess file by commenting out the default Access rules and putting in some temporary ones (don’t forget to change this back once you’re done)
  10. [code]#Order allow,deny
    #Allow from all
    Order deny,allow
    Deny from all
    Allow from #CHANGE THIS TO YOUR IP ADDRESS[/code]

  11. Finally, open your site in your browser to trigger the database upgrade, and fix any errors that pop up. If you are upgrading from version to, the database upgrade should go quite quickly. If you are upgrading from an earlier version to, expect it to take a few hours for this portion of the upgrade to complete. You may get errors along the way and the upgrade will “stall”. The first thing to try is to clear cache and sessions and refresh your site. If trying this once or twice doesn’t trigger the upgrade once again – the site will appear to be trying to load – then view the error report under var/reports and go from there. Other errors can show up in var/log/system.log or in the site PHP-FPM or Apache logs. Here is where you may need the assistance of a developer if you’re unable to get past errors thrown during the process. These errors can be for many reasons including: database integrity issues, modified Magento core files, and modifying/using the default Magento theme rather than setting up a separate custom theme.
  12. If the database upgrade completes successfully, you can now enjoy the new features and improved speed of the latest Magento Community offering.

Method 2: Upgrade using file copy

  1. After creating backups, create a separate directory on your account and call it what you like, eg: upgradeFiles. Clear Magento cache.
  2. From within this directory, download the tar.gz file for Magento 1.8. Here is a one-liner to grab it from their site:
  3. [code language=”bash”]export mageup_ver= && wget${mageup_ver}/magento-${mageup_ver}.tar.gz[/code]

  4. Extract the directory:
  5. [code language=”bash”]tar xfz magento-[/code]

  6. Copy upgrade version files over to your site. From within your Magento app document root, run:
  7. [code language=”bash”]cp -aR upgradeFiles/magento/* .[/code]

  8. Clear Magento cache once again.
  9. Follow Step 5 under Method 1 for disabling access to your site via .htaccess – to all but your IP.
  10. Follow Steps 6 and 7 above to trigger and complete the database upgrade portion of the site.

Which one to use: Method 1 or Method 2?

Method 2 allows you to have control over to which version you are upgrading. Method 1 will only allow you to upgrade to the latest stable version, which is currently If you want to upgrade incrementally rather than straight to version you would need to go with Method 2. The other advantage of Method 2 is that it allows you to see more clearly which files are being updated, and Magento core files that have been modified will be replaced with the stock files for the upgraded version.

As mentioned, upgrades from version 1.7 to 1.8 have gone quickly. The main issues that I’ve noticed are the following:

  • Extensions that are incompatible with version 1.8 – this should be checked for all extensions before upgrading.
  • Core_sessions errors. This can be resolved by setting sessions to use files, and clearing cache before beginning.
  • Some sites had issues with the ‘Place Order’ or ‘Order Submit’ button not working in their checkout. The reason for this varied but was usually due to a template or checkout module that was incompatible with version 1.8.

The reason for the ‘Place Order’ or ‘Order Submit’ button not working varied but was usually due to a template or checkout module that was incompatible with version 1.8. To fix this ussue, you will need to edit app/design/frontend/default/custom_theme_name/template/checkout/onepage/review/info.phtml in your custom theme. There is a bit of javascript that was changed at the end of the file. The code below shows you the code you will want to update to make your ‘Place Order’ or ‘Order Submit’ button work again.

Around line 79 in Magento
[code language=”javascript”]

Around line 79 in Magento
[code language=”javascript”]

Official guidelines:
Getting help:


Power up your sites and stores with custom-built technology designed to make every aspect of the digital commerce experience better. Make your digital commerce experience better with Nexcess.

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.