Last update: September 02, 2015
This is the most comprehensive description of the Magento 1.3.x, 1.4.x, 1.5.x, 1.6.x, 1.7.x, 1.8.x and 1.9.x upgrade process.
Additionally It contains step-by-step instructions and troubleshooting information.
Prepare for Magento upgrade (this part of the article is for old 1.3.x, 1.4.x versions only)
Lets imaging that you have old Magento 1.3.x - 1.4.x store and you need to upgrade it to latest Magento 1.9.x version. First of all it is highly recommended to backup your live store files/database and disable Magento compiler cache.
Next you need to get SSH access from your hosting provider and connect to your server via SSH protocol (using Linux command shell or Putty SSH client for Windows).
After connection via SSH, go to your store folder and execute these commands:
1 - Change permissions on lib/pear folder to writable (recursively):
chmod -R 777 lib/PEAR
2 - Execute this command to prepare Magento for upgrade:
./pear mage-setup
Most likely you will see this result after command execution:
Channel "connect.magentocommerce.com/core" is already initialized
Upgrade from Magento 1.3.x, old 1.4.x to Magento 1.4.2.0
Upgrade to 1.4.2.0 is required, even if you upgrade your old Magento 1.3.x store to 1.9.x version.
1 - Execute Magento upgrade command:
./pear upgrade -f magento-core/Mage_All_Latest-stable
Output of the command will show you what core packages were upgraded:
... upgrade ok: channel://connect.magentocommerce.com/core/Mage_Centinel-1.4.2.0 upgrade ok: channel://connect.magentocommerce.com/core/Interface_Frontend_Base_Default-1.4.2.0 upgrade ok: channel://connect.magentocommerce.com/core/Phoenix_Moneybookers-1.2.3 upgrade ok: channel://connect.magentocommerce.com/core/Find_Feed-1.0.7 upgrade ok: channel://connect.magentocommerce.com/core/Interface_Adminhtml_Default-1.4.2.0
2 - When this part of the upgrade will be complete, enter these commands:
chmod 550 ./mage ./mage mage-setup .
You will see this result after command execution:
Successfully added: http://connect20.magentocommerce.com/community
It means that Magento connect 2.0 channel was added to the channels list successfully.
3 - Next, enter this command:
./mage sync
The result will be:
... Successfully added: community/Mage_Locale_en_US-1.4.2.0 Successfully added: community/Interface_Install_Default-1.4.2.0 Successfully added: community/Phoenix_Moneybookers-1.2.3 Successfully added: community/Mage_Downloader-1.5.0.0 Successfully added: community/Lib_Google_Checkout-1.4.2.0
Upgrade to Magento 1.4.2.0 is complete and now you can proceed with upgrade to Magento 1.9.x version.
Upgrade from Magento 1.4.x, 1.5.x, 1.6.x to Magento 1.9.x
Now you can upgrade your store to version 1.9.x.
Before proceeding with this part of Magento upgrade, it is important to see to what version Magento upgrade scripts will upgrade your store. Enter this command to check this:
./mage list-upgrades
If you will see this result:
Updates for community: Mage_All_Latest: 1.4.2.1 => 1.9.1.0 Lib_Js_Mage: 1.4.2.0 => 1.9.1.0 Lib_Varien: 1.4.2.0 => 1.9.1.0
It means that your Magento will be upgraded to version 1.9.1.0. If it is not what you need you can change upgrade channel to "beta" and upgrade your Magento to RC (beta) version.
1 - Enter this command to change the upgrade channel to stable (remember, "stable" channel will upgrade your Magento to latest 1.9.x stable version):
./mage config-set preferred_state stable
After this the "./mage list-upgrades" command will show you this result:
Updates for community: Mage_All_Latest: 1.4.2.1 => 1.9.1.0 Lib_Js_Mage: 1.4.2.0 => 1.9.1.0 Lib_Varien: 1.4.2.0 => 1.9.1.0 Lib_Phpseclib: 1.4.2.0 => 1.9.1.0 Mage_Core_Adminhtml: 1.4.2.0 => 1.9.1.0 Mage_Core_Modules: 1.4.2.0 => 1.9.1.0
2 - After channel selection you can upgrade your Magento to Magento 1.9.x) using this command:
./mage upgrade-all --force
If "./mage upgrade-all --force" will not work, you can try to execute this command:
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
You will see upgraded packages on your screen:
... Package upgraded: community/Mage_Locale_en_US 1.9.1.0 Package upgraded: community/Lib_Mage 1.9.1.0 Package upgraded: community/Lib_ZF 1.11.1.0 Package upgraded: community/Lib_Js_Prototype 1.9.1.0 Package upgraded: community/Lib_ZF_Locale 1.11.1.0
Now the upgrade is complete and you can execute database upgrade visiting your Magento store in your browser, this process will take several minutes, so be patient. If everything was upgraded correctly, you will see upgraded store in your browser. Before database upgrade it is recommended to increase time and memory limits of your PHP engine.
If it is not possible to increase it, you can try to execute database upgrade via SSH, e.g.:
php -f ./index.php
When database upgrade will be finished, you can check version of your store in the footer of Magento administration panel.
Need professional help with Magento upgrade?
ASTRIO.net offers professional Magento services, including Magento development and Magento upgrade service. Feel free to contact our team.
Troubleshooting
1 - Magento upgrade script error:
upgrade-all: Please check for sufficient write file permissions. Error: upgrade-all: Your Magento folder does not have sufficient write permissions, which downloader requires.
Execute this command to fix the error:
chmod -R 777 Upgrade
2 - Magento upgrade script error:
upgrade-all: Invalid stability in compareStabilities argument.
Execute these commands, it will fix the issue:
./mage channel-add connect20.magentocommerce.com/community ./mage channel-add connect20.magentocommerce.com/core ./mage sync
Or as a solution you can run this command:
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
3 - Server error:
"Internal Server Error" instead of Magento storefront page or administration zone pages.
Most likely issue is connected with wrong permissions.
Fix this issue using these recursive commands:
find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \;
4 - Magento error: Different errors in Magento database.
Reindex your database in Magento administration panel and clear Magento cache.
5 - Magento error:
"Invalid mode for clean() method".
Clear Zend cache (all files, including "Backend" folder) in [magento_folder]/app/code/core/Zend/Cache/
6 - Magento error:
"Call to a member function toHtml() on a non-object in .../Layout.php".
Open [magento_folder]/app/design/frontend/default/[your_theme]/layout/page.xml and replace this line of the code:
<block type="core/profiler" output="toHtml"/>
With:
<block type="core/profiler" output="toHtml" name="core_profiler"/>
7 - Magento error:
"Maximum key size must be smaller 32".
Clear Magento cache.
8 - Pagination is not showing on product listing:
Open this file: app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php
And replace this line of the code:
class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Core_Block_Template
with:
class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Page_Block_Html_Pager
9 - Magento error:
Column not found: 1054 Unknown column 'custom_use_parent_settings' in 'where clause'
Reindex your database using Linux shell.
10 - Magento error:
Cannot connect to the database
Check the /app/etc/local.xml and make sure that there is such code:
<model>{{db_model}}</model>
This is server side error:
Fatal error: Out of memory
Please contact your hosting provider for support.
I recommend to hire professional Magento developers for investigation of this security problem. It could be connected with some specific server settings.
SECURITY ERROR: package in channel "connect.magentocommerce.com/core" retrieved another channel's name for download! ("pear.php.net")
Cannot initialize 'channel://connect.magentocommerce.com/core/Mage_All_Latest-stable', invalid or missing package file
Package "channel://connect.magentocommerce.com/core/Mage_All_Latest-stable" is not valid
upgrade failed
I have a similar problem as in some of the previous comments. After ./pear upgrade -f magento-core/Mage_All_Latest-stable
there is no ./mage file. I can see it neither via FTP nor via SSH. Hence, I can't change the permissions on the file since it really is not present. I can't even see it if I login as root. It just isn't there.
sh-4.1$ ./pear upgrade -f magento-core/Mage_All_Latest-stable
warning: magento-core/Mage_All_Latest requires package "magento-core/Mage_Core_Adminhtml" (version >= 1.4.2.0, version <= 1.4.2.0)
warning: magento-core/Mage_All_Latest requires package "magento-core/Interface_Adminhtml_Default" (version >= 1.4.2.0, version <= 1.4.2.0)
warning: magento-core/Mage_All_Latest requires package "magento-core/Interface_Frontend_Default" (version >= 1.4.2.0, version <= 1.4.2.0)
warning: magento-core/Mage_All_Latest requires package "magento-core/Interface_Install_Default" (version >= 1.4.2.0, version <= 1.4.2.0)
warning: magento-core/Mage_All_Latest requires package "magento-core/Mage_Downloader" (version >= 1.5.0.0, version <= 1.5.0.0)
warning: magento-core/Mage_All_Latest requires package "magento-core/Mage_Centinel" (version >= 1.4.2.0, version <= 1.4.2.0)
warning: magento-core/Mage_All_Latest requires package "magento-core/Interface_Frontend_Base_Default" (version >= 1.4.2.0, version <= 1.4.2.0)
warning: magento-core/Mage_All_Latest requires package "magento-core/Phoenix_Moneybookers" (version >= 1.2.3, version <= 1.2.3)
warning: magento-core/Mage_Core_Modules requires package "magento-core/Lib_Varien" (version >= 1.4.2.0, version <= 1.4.3, excluded versions: 1.4.3)
warning: magento-core/Mage_Core_Modules requires package "magento-core/Lib_Google_Checkout" (version >= 1.4.2.0, version <= 1.4.3, excluded versions: 1.4.3)
warning: magento-core/Mage_Core_Modules requires package "magento-core/Lib_Js_Calendar" (version >= 1.51.1, version <= 1.52, excluded versions: 1.52)
warning: magento-core/Mage_Core_Modules requires package "magento-core/Lib_Js_Mage" (version >= 1.4.2.0, version <= 1.4.3, excluded versions: 1.4.3)
warning: magento-core/Mage_Core_Modules requires package "magento-core/Lib_Js_Prototype" (version >= 1.6.0.3.3, version <= 1.6.1, excluded versions: 1.6.1)
warning: magento-core/Mage_Core_Modules requires package "magento-core/Lib_PEAR" (version >= 1.4.0.0, version <= 1.4.1, excluded versions: 1.4.1)
downloading Mage_All_Latest-1.4.2.1.tgz ...
Starting to download Mage_All_Latest-1.4.2.1.tgz (1,020 bytes)
....done: 1,020 bytes
downloading Find_Feed-1.0.7.tgz ...
Starting to download Find_Feed-1.0.7.tgz (14,093 bytes)
...done: 14,093 bytes
downloading Mage_Core_Modules-1.4.2.0.tgz ...
Starting to download Mage_Core_Modules-1.4.2.0.tgz (1,927,551 bytes)
...done: 1,927,551 bytes
downloading Lib_Phpseclib-1.4.2.0.tgz ...
Starting to download Lib_Phpseclib-1.4.2.0.tgz (110,987 bytes)
...done: 110,987 bytes
upgrade ok: channel://connect.magentocommerce.com/core/Lib_Phpseclib-1.4.2.0
upgrade ok: channel://connect.magentocommerce.com/core/Mage_Core_Modules-1.4.2.0
upgrade ok: channel://connect.magentocommerce.com/core/Find_Feed-1.0.7
upgrade ok: channel://connect.magentocommerce.com/core/Mage_All_Latest-1.4.2.1
sh-4.1$ chmod 550 ./mage
chmod: cannot access `./mage': No such file or directory
ANY help is greatly appreciated - this is driving me utterly crazy.
Regards,
Julian
-bash: ./mage: No such file or directory'. When I watch the file mage with FTP, permission is 755. Any idea what is going wrong?
Hope you could help me. Many thanks!
Please initialize Magento Connect installer by running:
./mage mage-setup
Check if you are affected by the problem described here (use php-cli when running fastcgi):
http://www.magentocommerce.com/boards/error.php/viewthread/301933/#t419848
hth,
Larsen