Magento 1.5 to 1.6 upgrade

Last modified by helmutlangmann on Sun, August 26, 2012 06:14
Source|Old Revisions  

Upgrading to version 1.6 from 1.5 via SSH

This is a short explanation on how to upgrade to version 1.6 from version 1.5. I will continue to add to this WIKI as I have time.

find . -type f -exec chmod 777 {} \;
find . -type d -exec chmod 777 {} \;
rm -rf var/cache/* var/session/*
chmod 550 ./mage
./mage mage-setup .
./mage config-set preferred_state stable
./mage list-installed
./mage list-upgrades
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
php shell/indexer.php reindexall
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

Make sure to http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions once the process.

This is the most comprehensive description of the Magento 1.3.x, 1.4.x, 1.5.x, 1.6.x and 1.7.x upgrade process. It contains step-by-step instructions and troubleshooting information: http://turnkeye.com/blog/magento-upgrade-guide/

Important dont's

Don’t access your site triggering all the upgrades before your run the code mentioned above: php shell/indexer.php reindexall

Potential problems with your upgrade

I don’t know why, but there’s an error occurred by a missing file...

PHP Fatal error:  Class 'Mage_Catalog_Model_Resource_Setup' not found in /var/www/vhosts/domain.com/httpdocs/app/code/community/Find/Feed/Model/Resource/Setup.php on line 33

Download it from SVN and upload it to “app/code/core/Mage/Catalog/Model/Resource/”:

cd app/code/core/Mage/Catalog/Model/Resource/
wget http://svn.magentocommerce.com/source/branches/1.6/app/code/core/Mage/Catalog/Model/Resource/Setup.php
chown user:group Setup.php

Magento Connect shows everything is in the new version, but the admin footer shows the previous version because app/Mage.php wasn’t updated.

cd /var/www/vhosts/sibalen.com.br/subdomains/atacado/httpdocs/app/
mv Mage.php Mage.bkp.php
wget http://svn.magentocommerce.com/source/branches/1.6/app/Mage.php
chown user:group Mage.php

Stops at "sales_flat_order_item"

If you encounter the error

“Error in file: “/xxx/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php” - SQLSTATE[HY000]: General error: 1025 Error on rename of ‘./magento/#sql-25de_742’ to ‘./magento/sales_flat_order_item’ (errno: 150)” 

The you have an issue with the index of this table. So before you start your upgrade again

ALTER TABLE sales_flat_order_item DROP INDEX IDX_ORDER , ADD INDEX IDX_SALES_FLAT_ORDER_ITEM_ORDER_ID ( order_id ) 
ALTER TABLE sales_flat_order_item DROP INDEX IDX_STORE_ID , ADD INDEX IDX_SALES_FLAT_ORDER_ITEM_STORE_ID ( store_id )
ALTER TABLE sales_flat_order_item DROP INDEX IDX_PRODUCT_ID 

Stops at "1025 Error on rename of catalog_category_flat_store_1"

If you encounter the error

Error in file: "/xxx/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php" - SQLSTATE[HY000]: General error: 1025 Error on rename of './catalog_category_flat_store_1' to './#sql2-6221-31dae3' (errno: 152)” 

A solution may be (as found @ http://technooze.com/blog/92/114/magento-index-management-Cannot-initialize-the-indexer-process)

ALTER TABLE catalog_category_entity ENGINE=INNODB;
ALTER TABLE core_store ENGINE=INNODB;
ALTER TABLE catalog_category_entity ENGINE=INNODB;
ALTER TABLE core_store ENGINE=INNODB;

Column "date" does not exists on table "catalog_product_index_website

A part of the solution was found here @ http://www.magentocommerce.com/boards/viewthread/266431/

Solution: Edit the file mentioned in the error and comment out the line where the field date is being renamed to website_date. Apparently the error occurs because the rename was already executed before.

/**
$installer->getConnection()->changeColumn(
    $installer->getTable('catalog/product_index_website'),
    'date',
    'website_date',
    array(
        'type'      => Varien_Db_Ddl_Table::TYPE_DATE,
        'comment'   => 'Website Date'
    )
);
**/

All sort of tables exist, or keys dont

And after that? I came across numerous errors with index/keys that could not be dropped and tables that were already created. No idea how this could happen, but hey ... !

Copied the upgrade file location in my fav editor. OPened file. Looked for table or column that was mentioned in the error and uncommented the code.

After that go back to site root via http and open the site again. Waiting for the next error.

'Mage registry key "_resource_helper/core" already exists'

If you get this error, just delete the cache and sessions again:

rm -rf var/cache/* var/session/*

Unique constraint issue

If your install encounters unique constraint issues first check that you have enough time to execute the upgrade in PHP. The Magento default for php_value max_execution_time=18000.

Other comments

- I haven’t come across the unique constraint error but completely disabling the database’s mechanism to keep itself consistent seems a too heavy-handed approach. (fooman)

- - Agree with this completely, this seems like insane advice. Foreign keys are a big part of how Magento works. (edmondscommerce)

- But if you are having constraint errors the above helps (brent w peterson)

- But this still not solves the base problem. Magento devs should work on improving upgrade path. (blitux)

- - @brent w peterson - Disabling your databases integrity constraint system is a guaranteed path to incredibly difficult to support and troubleshoot issues later. It is a hack that makes the upgrade script not crash with an error, it does NOT actually fix the problem in any way shape or form. (Jim O’Halloran)




 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs