Magento version 220.127.116.11 was released on February 9th, 2011. It adds a number of performance improvements in the areas of dataflow and checkout, and comes with the hot new Magento Mobile module installed. While we have not run into the same sorts of upgrade woes that plagued the 1.3 and 1.4 releases, the upgrade method itself has changed due to the new Magento Connect version 2.
Here at Nexcess, we perform upgrades via the command line, as it is quicker and we can better see what is happening should anything go wrong. The old tool for upgrading via SSH was the “pear” installer that came bundled with Magento. With the release of Magento 1.5.x, this tool will no longer work. Using it will only upgrade you as far as 18.104.22.168, however, it will download the new tool designed to work with Magento Connect 2.0 – the “mage” installer. The following outline how to upgrade to the latest version of Magento using the command line tools.
- First and foremost, always create a backup of your database and code before making any major changes. There are a few ways to do this, but the simplest is to use mysqldump and tar.
- Once you have everything backed up, you can use the “pear” tool to upgrade to the latest version on the old Magento Connect and also download the new “mage” tool.
- When this is finished, don’t bother trying to fix errors. Just continue upgrading as some common errors will be fixed when you get to 1.5. In your magento root directory, you will see a new file called “mage”. First you want to make this script executable:
- Now you can use the “mage” tool to finish the upgrade. The syntax is slightly different from the “pear” tool, but you can always type “./mage help” to see a list of commands, and “./mage help command” to see help for a specific command. First you initialize the new Magento Connect registry and channel:
- Edit 2011-07-19: As many of you have indicated in the comments, the default preference for the new “mage” tool is Beta. This will cause problems when Magento releases a beta or release candidate into the channel. To get around this, you just need to change the preferred state of the “mage” tool:
- Note that one significant change is that there is only one channel: connect20.magentocommerce.com/community. By putting everything into the “community” channel, I think Magento hopes to avoid the upgrade headaches that cropped up in previous versions. We’ll see why in a minute. Next you need to sync the old Magento Connect registry – the core and community extensions you already have – with the new 2.0 registry.
- 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.
- 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):
- Finally, Open your site in your browser to trigger the database upgrade, and fix any errors that pop up. As I mentioned above, we haven’t come across any inherent upgrade bugs like there were in 1.3 and 1.4, and the move from 1.4.2 to 22.214.171.124 is pretty seamless. You can now enjoy the new features and improved speed of the latest Magento Community offering.
[bash]./pear upgrade -f magento-core/Mage_All_Latest-stable[/bash]
[bash]chmod 550 ./mage[/bash]
[bash]./mage mage-setup .[/bash]
[bash]./mage config-set preferred_state stable[/bash]
[bash]./mage upgrade-all –force[/bash]
[bash] #Order allow,deny
#Allow from all
Deny from all
Allow from 192.168.1.1 #CHANGE THIS TO YOUR IP ADDRESS[/bash]