Magento 1.5 to 1.6 upgrade
This is an old revision of the document!
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.
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
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
If you encounter the error
“Error in file: “/xxx/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-188.8.131.52-184.108.40.206.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
If your install encounters unique constraint issues first check that you have enough time to execute the upgrade in PHP. Defaults for php_value max_execution_time=18000. You may also want to consider modifying your /app/etc/config.xml with the follow:
<initStatements>SET NAMES utf8</initStatements>
<initStatements>SET NAMES utf8; SET FOREIGN_KEY_CHECKS=0; SET UNIQUE_CHECKS=0;</initStatements>
- 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)
- 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)