Forums / Upgrading from 1.3.x to 1.3.9 / 1062 Duplicate entry 'Customers who have never completed a purchase' for key 2

1062 Duplicate entry 'Customers who have never completed a purchase' for key 2

Locked

Views: 1,067

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
8 Jul 2010, 3:42 AM
#1
maperr55 avatar

maperr55

Zen Follower

Join Date:
Aug 2007
Location:
Manitou Beach, Michigan
Posts:
357
Plugin Contributions:
0

1062 Duplicate entry 'Customers who have never completed a purchase' for key 2

Hi, I am upgrading all my carts and it has been going well I guess. wish there was a way to test if everything was done correctly and no critical files were over written.

I am running into a strange error. I backed up my old cart. Installed a new copy of 139d. When I went to restored my backup I found it was damaged some how and I could not use it. I found a backup that was from a 137 cart and database. I restored from it ok said of course that the DB needed to be patched. When I run the DB update I get this error:

1062 Duplicate entry 'Customers who have never completed a purchase' for key 2
in:
[INSERT INTO gallquery_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');]

Anything I can do or am I toast?

8 Jul 2010, 4:00 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: 1062 Duplicate entry 'Customers who have never completed a purchase' for key 2

That's happening because you're trying to do an upgrade step that's already been done once.
I share some ideas on this thread for getting around that particular problem: http://www.zen-cart.com/forum/showthread.php?t=82998

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Jul 2010, 1:00 PM
#3
maperr55 avatar

maperr55

Zen Follower

Join Date:
Aug 2007
Location:
Manitou Beach, Michigan
Posts:
357
Plugin Contributions:
0

Re: 1062 Duplicate entry 'Customers who have never completed a purchase' for key 2

Hi Doc,
I ran the sql query and it appears to correct the problem for that then I got this;

1253 COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8'
in:
[CREATE TABLE gallcounter_history_clean as SELECT * FROM gallcounter_history WHERE 1 GROUP BY startdate COLLATE latin1_general_ci;]


I looked through the entire DB and changed the collation any where I found latin1_general_ci which was in a few places but I still get the error. ????

8 Jul 2010, 6:07 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: 1062 Duplicate entry 'Customers who have never completed a purchase' for key 2

Evidently your database is set to utf8, not latin1 which is assumed by default.
Change the DB_CHARSET in zc_install/includes/installer_params from 'latin1' to 'utf8'

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Jul 2010, 2:37 AM
#5
maperr55 avatar

maperr55

Zen Follower

Join Date:
Aug 2007
Location:
Manitou Beach, Michigan
Posts:
357
Plugin Contributions:
0

Re: 1062 Duplicate entry 'Customers who have never completed a purchase' for key 2

Hi Doc, That took care of it. Is it OK or a problem if it skips an entry because something already exists?

9 Jul 2010, 4:14 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: 1062 Duplicate entry 'Customers who have never completed a purchase' for key 2

The system normally intelligently skips things that have already been done, and simply displays a note about it. For the most part it's safe to ignore those.
Carry on.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.