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, 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

Magento Forum

Errors during installation
Total Posts:  40
Joined:  2010-12-05

Hi all smile

I have been trying to upgrade my installation now for weeks, but im not having any success.. these are the errors from the last attempt.

a:5:{i:0;s:243:"Error in file: “/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-” - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘0-11’ for key ‘UNQ_BY_CUSTOMER‘“;i:1;s:1100:"#0

a:5:{i:0;s:249:"Error in file: “/app/code/core/Mage/Index/sql/index_setup/mysql4-upgrade-” - SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name ‘UNQ_INDEX_EVENT_TYPE_ENTITY_ENTITY_PK‘“;i:1;s:1236:"#0

Any help would be much appreciated, as I am at a loss as to what to do.

I tried editing config.xml even with the following,

<initstatements>SET NAMES utf8; SET FOREIGN_KEY_CHECKS=0; SET UNIQUE_CHECKS=0;</initstatements>

but it doesnt make any difference :(

Thanks in advance for any help or suggestions, I really need to get this upgraded.

Magento Community Magento Community
Magento Community
Magento Community
Total Posts:  40
Joined:  2010-12-05

anybody able to help?

would be appreciated.. Thanks

Magento Community Magento Community
Magento Community
Magento Community
Total Posts:  40
Joined:  2010-12-05

Im surprised that with so many Magento developers and users nobody has been able to help me.

Anyway, I have found the problem, fixed it and successfully upgraded to

The config.xml file alteration did not work in my case, but I would not advise that as a fix anyway as it just covers up database corruption.

Before Reading further, make sure everything is backed up sufficiently, website, and data and dont make changes to your live production database..and as always take precautions! I will not be held responsible for any problems caused… process at your own risk.

anyway. heres what I did…

Important to follow exactly,

Do a database backup, inside magento.

Download the database backup.

Import it into a new database.

Open new database in phpmyadmin.

Run the following query on the new copy database,


TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_viewed_product_index;
TRUNCATE report_compared_product_index;
TRUNCATE report_event;
TRUNCATE index_event;
TRUNCATE index_process_event;

Log into your FTP

Make a copy of local.xml under App, etc.

Open copied local.xml file, and change the database name, username, password to match your database copy credentials and name. (the database you just run the Truncate queries on).

Rename original local.xml file on FTP to local.xml.original

Upload modified local.xml

Access website admin/management area..(should now be running from the copy database and not the original)

Go to \"System\" \"Index Management\”

\"Select All\” --> \"Actions: Reindex all\” --> Submit

(Reason for opening up the website using the copied database, and running full index is to rebuild the index;s… I failed to do this first time, and what happened was my original error went and was replaced with another error during the upgrade installation.)

Once index complete, log back into your FTP.. rename local.xml to local.xml.modified, and rename local.xml.original to just local.xml in order to restore your website to using current production database.

Now website should still be running fine as it was before.

Next run upgrade as normal, and when it asks for the database details, name, credentials etc… just enter details of your copy database which you run the truncate and re-index on… as this will become the upgraded database.

Install should then complete properly smile

As a precautionary after step, I also always run the Magento Database Repair Tool to compare your upgraded database to a clean database… in my case on this occasion it did find 1 or 2 problems and fixed them.. problems which it didnt find prior to the upgrade.

Now my website is working fine under and database seems to be corruption free smile

Hope all the above helps!

Magento Community Magento Community
Magento Community
Magento Community
Jr. Member
Total Posts:  2
Joined:  2012-09-15

I had similar problem during upgrade and it was caused by limited script execution time. I just ran script from command line:

php -./index.php
and it completed successfully.
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top