Zen Cart Logo
Forums / Upgrading from 1.2 to 1.3.x / DB Upgrade error

DB Upgrade error

Views: 29,381

Results 1 to 6 of 6
14 Dec 2012, 9:00 PM
#1
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

DB Upgrade error

Trying to upgrade a 1.2.6 cart to 1.5.1
Performing upgrades manually one at a time
During the DB upgrade steps I get to 1.3.7 to 1.3.8 and I receive this message

WARNING: An Error occurred, please refresh the page and try again.

Have not a clue as to what to try next

14 Dec 2012, 9:14 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: DB Upgrade error

Are there any log files in the /logs folder? Did you change the collation of the database for the upgrade?

14 Dec 2012, 10:52 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: DB Upgrade error

Log has this in it

PHP Fatal error:  1062:Duplicate entry 'Customers who have never completed a purchase' for key 'query_name' :: INSERT INTO query_builder (query_category, query_name, query_description , query_string) VALUES ('email,newsletters', 'Customers who have never completed a purchase', 'For sending newsletter to all customers who registered but have never completed a purchase', 'SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN  TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL'); in /home/armorhea/public_html/includes/classes/db/mysql/query_factory.php on line 120

Off to search for 1062:Duplicate entry

14 Dec 2012, 11:04 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: DB Upgrade error

Just skipped 1.3.7 to 1.3.8
excecuted form 1.3.8 to 1.3.9 and all others
Not positive what impact this will have

14 Dec 2012, 11:04 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: DB Upgrade error

That error is telling you that the SQL is attempting to insert a record that already exists.
Chances are that's because the storeowner has applied small fixes from the forum and has created a clash.
Simplest solution is to delete that record from the database. The error message tells you which record and which table.
Alternatively you could comment out that particular INSERT statement from the upgrade SQL file.