Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Upgrade Error during cache cleaning
 
Mystral
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2011-08-09
 

Hello,

Here is the error I have during the upgrade procedure from 1.6 to 1.7 :

Exception during cache and session cleaningError in file"D:\www\magento\app\code\core\Mage\XmlConnect\sql\xmlconnect_setup\mysql4-data-upgrade-1.6.0.0-1.6.0.0.1.php" SQLSTATE[HY000]General error1452 Cannot add or update a child rowa foreign key constraint fails (`magentoprod`.`xmlconnect_images`, CONSTRAINT `FK_6C55A623A089E4FEA9201FFE01693167FOREIGN KEY (`application_id`) REFERENCES `xmlconnect_application` (`application_id`) ON DELETE CASCADE ON U)

Does someone have an idea to solve this error ?

Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
Eiman
Jr. Member
 
Total Posts:  1
Joined:  2012-11-18
 

Hello,
there are several things that possible could go wrong. that is why there are several solutions:
1.Ran the following SQL to find the rows that were causing the problem, then deleted the rows and ran the indexer again
SELECT *
FROM `catalog_category_product`
WHERE `category_id` NOT
IN (
SELECT `entity_id`
FROM `catalog_category_entity`
)

2. Export your original database using PhpMyAdmin. From the Options section in PhpMyAdmin, find and select:
Disable foreign key checks

3. Using any Linux editor such as vi or pico, edit the database file: YOUR-DATABASE-NAME.sql. Copy and paste the following line at the beginning of the file:
SET foreign_key_checks=0;

4. Go to in Model and find this code in any php file and make some changes.
the line: $newproduct->setWebsiteIDs(array(0)); should be: $newproduct->setWebsiteIDs(array(1));

As an alternative for manipulation with php and your database you may try Cart2Cart migration service. It will require to install a fresh version of Magento and then migrate your products, clients and orders from your current Magento version. However, you won\’t be able to move design.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kalenjordan
Sr. Member
 
Avatar
Total Posts:  218
Joined:  2011-10-31
Pasadena, CA
 

It might be worthwhile to tail your var/debug/pdo_mysql.log file while it runs so that you can see what the exact query is that’s failing.  There is probably a reason that a foreign key constraint is failing, and you may want to try and get at the root cause of it.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top