Why upgrading Magento 1.5.1.0 to 1.6.0.0 fails? [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionSome time ago I upgraded a Magent开发者_如何学Pythono store 1.4.2.0 to version 1.5.1.0, and the upgrade process was ok. I got some bug/errors though and would like to upgrade Magento to 1.6.0.0, as it is a stable release now.
I downloaded magento 1.6 and followed the installation process, using the old database. After the screen where I type my database acess data, I got an Magento report. It says:
"Error in file: "/home/italo/www/mage_powershop/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php" - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'son_id'"
I tried also install magento 1.6.0.0 in a new database and then import data from old database, but I got the same problem. (Actually, almost the same, as the key wasn't 'son_id', but it always change anyway...) The installation in a new database runs fine. I tried to use the Magento Repair Database Tool, but it returned a error.
Can anybody help me out with this?
I got this working on!
I just disabled the foreign keys and unique checks. In the /app/etc/config.xml file I changed the initStatements node from:
<initStatements>SET NAMES utf8</initStatements>
to:
<initStatements>SET NAMES utf8; SET FOREIGN_KEY_CHECKS=0; SET UNIQUE_CHECKS=0;</initStatements>
Problem is in your data stored in tables. In Magento tables is no index with name "son_id". Maybe any custom module added some fields to Magento core tables and added new indexes. In this case you can not upgrade automatically.
Find table with index named "son_id" and look at data in this field. Maybe you can modify this data to unique values to upgrade...
精彩评论