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>
All is fine before this step.
My configuration is 1&1 dedicated (debian 4).
I hope someone can help ...
No actions selected
so i selct an option press upgrade and nothing hapends.
i dont get any further. i stuck on 1.4.2.0 and in putty i allways getthese massages:
Please initialize Magento Connect installer by running:
./mage mage-setup
also putty shows in most time no output massages like we can read abouve, so i type in the orders and nothing coms out
but how do i upgrade it on xampp under windows?
./pear etc. wont work!
Any suggestions????
There has been an error processing your request
Wrong Content Type.
Trace:
#0 /public_html/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php(397): Mage::throwException(’Wrong Content T...’)
#1 /public_html/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allmethods.php(44): Mage_Usa_Model_Shipping_Carrier_Dhl_International->getAllowedMethods()
#2 /public_html/app/code/community/BL/OrdersGrid/Model/Grid/Type/Sales/Order.php(110): Mage_Adminhtml_Model_System_Config_Source_Shipping_Allmethods->toOptionArray()
#3 /public_html/app/code/community/BL/CustomGrid/Model/Grid/Type/Abstract.php(96): BL_OrdersGrid_Model_Grid_Type_Sales_Order->_getColumnsLockedValues(’adminhtml/sales...’)
#4 /public_html/app/code/community/BL/CustomGrid/Model/Grid/Type/Abstract.php(111): BL_CustomGrid_Model_Grid_Type_Abstract->getColumnsLockedValues(’adminhtml/sales...’)
#5 /public_html/app/code/community/BL/CustomGrid/Model/Grid.php(591): BL_CustomGrid_Model_Grid_Type_Abstract->getColumnLockedValues(’adminhtml/sales...’, ‘blog_billing_co...’)
#6 /public_html/app/code/community/BL/CustomGrid/Model/Grid.php(1208): BL_CustomGrid_Model_Grid->getColumnLockedValues(’blog_billing_co...’)
#7 /public_html/app/code/community/BL/CustomGrid/Model/Observer.php(775): BL_CustomGrid_Model_Grid->applyColumnsToGridBlock(Object(BL_CustomGrid_Block_Rewrite_Sales_Order_Grid), true)
#8 /public_html/app/code/community/BL/CustomGrid/Model/Observer.php(390) : eval()’d code(67): BL_CustomGrid_Model_Observer->afterGridPrepareCollection(Object(BL_CustomGrid_Block_Rewrite_Sales_Order_Grid))
#9 /public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(626): BL_CustomGrid_Block_Rewrite_Sales_Order_Grid->_prepareCollection()
#10 /public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(632): Mage_Adminhtml_Block_Widget_Grid->_prepareGrid()
#11 /public_html/app/code/core/Mage/Core/Block/Abstract.php(862): Mage_Adminhtml_Block_Widget_Grid->_beforeToHtml()
#12 /public_html/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#13 /public_html/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml(’grid’, true)
#14 /public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php(77): Mage_Core_Block_Abstract->getChildHtml(’grid’)
#15 /public_html/app/design/adminhtml/default/default/template/widget/grid/container.phtml(36): Mage_Adminhtml_Block_Widget_Grid_Container->getGridHtml()
#16 /public_html/app/code/core/Mage/Core/Block/Template.php(241): include(’/...’)
#17 /public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView(’adminhtml/defau...’)
#18 /public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#19 /public_html/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#20 /public_html/app/code/core/Mage/Adminhtml/Block/Widget/Container.php(308): Mage_Adminhtml_Block_Template->_toHtml()
#21 /public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Adminhtml_Block_Widget_Container->_toHtml()
#22 /public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#23 /public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#24 /public_html/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#25 /public_html/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml(’content’, true)
#26 /public_html/app/design/adminhtml/default/default/template/page.phtml(74): Mage_Core_Block_Abstract->getChildHtml(’content’)
#27 /public_html/app/code/core/Mage/Core/Block/Template.php(241): include(’/...’)
#28 /public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView(’adminhtml/defau...’)
#29 /public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#30 /public_html/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#31 /public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Adminhtml_Block_Template->_toHtml()
#32 /public_html/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#33 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#34 /public_html/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(95): Mage_Core_Controller_Varien_Action->renderLayout()
#35 /public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Adminhtml_Sales_OrderController->indexAction()
#36 /public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch(’index’)
#37 /public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#38 /public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#39 /public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#40 /public_html/index.php(87): Mage::run(’’, ‘store’)
#41 {main}
I go to backend, login, got a error processing request, refreshed, it was ok... go to cache and reindex and i keep getting 500 errors whenever i try to refresh stuff....
I'll try testing other stuff in the meatime but if you have any input i'd appreciate it...
Internal server error 500 is server related error. You can find exact reason/error description in server error log.
Also, seems that you run database upgrade several times?
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
-When i copied this from above, it pasted incorrectly for some reason as "./mage install http://connect20.magentocommerce.com/community Mage_All_Latest ?force", so i typed it manually..
I then ran:
rm -rf var/cache/* var/session/*
Navigated to the site, got "there's an error processing your request"
I typed:
php -f ./index.php
It output the following which i could only see the end of in my ssh screen but this at the end concerned me:
--------------------------------------
[errorInfo] => Array
(
[0] => HY000
[1] => 1025
[2] => Error on rename of './cw_db/catalog_product_index_price' to './cw_db/#sql2-14d3- 2091' (errno: 152)
)
)
window.location.href = 'http://localhost./errors/report.php?id
--------------------------------------
I navigated to the store, it showed up however the product catalog was out of order, so i logged in to clear the cache and reindex... when i cleared the cache, i got an internal server error 500, not sure why, any idea? Going to the site did the same thing, i figured there was a php script still running perhaps so i waited a bit, but when the store showed up, i got another error "there is an error processing your request" so i viewed the log file and it said this:
a:5:{i:0;s:273:"Error in file: "/var/www/vhosts/corvette-wheels.com/httpdocs/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php" - SQLSTATE[HY000]: Gener$
#1 /var/www/vhosts/corvette-wheels.com/httpdocs/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '0.8.28', '1$
#2 /var/www/vhosts/corvette-wheels.com/httpdocs/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('0.8.28', '1.6.0.2')
#3 /var/www/vhosts/corvette-wheels.com/httpdocs/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /var/www/vhosts/corvette-wheels.com/httpdocs/app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /var/www/vhosts/corvette-wheels.com/httpdocs/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 /var/www/vhosts/corvette-wheels.com/httpdocs/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /var/www/vhosts/corvette-wheels.com/httpdocs/index.php(87): Mage::run('', 'store')
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}
So I'm not sure what to do from here... I restore the original site and i'll try again another time... Please let me know if you have any idea what i did wrong or what i could do different... Thanks again for all your help!!!
Thanks for the guide, i appreciate your work, however, i'm not getting very far... I have 1.5.0.1 installed, and when i run the command "./mage list-upgrades" it says " no upgrades available...
I tried running some other commands (below) and retrying but still no difference.. not sure what to do from here...
./mage mage-setup .
./mage config-set preferred_state stable
./mage list-upgrades
./mage channel-add connect20.magentocommerce.com/community
./mage channel-add connect20.magentocommerce.com/core
./mage sync
./mage list-upgrades
Call to a member function save() on a non-object in /home/coreligh/public_html/lib/Varien/Data/Collection/Db.php on line 755