Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / SQL Errors when importing to new database - #1062 - Duplicate entry '3' for key 1

SQL Errors when importing to new database - #1062 - Duplicate entry '3' for key 1

Locked

Views: 2,286

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
17 Sep 2009, 3:16 PM
#1
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

SQL Errors when importing to new database - #1062 - Duplicate entry '3' for key 1

I am upgrading from
Zen Cart 1.3.7.1

Patch: 1::

Database Patch Level: 1.3.7

v1.3.6 [2006-12-19 18:41:45] (Fresh Installation)
And I keep getting errors while importing my database...

SQL query:
-- -- Dumping data for table orders -- INSERT INTO orders (orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, payment_module_code, shipping_method, shipping_module_code, coupon_code, cc_type, cc_owner, cc_number, cc_expires, cc_cvv, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value, order_total, `order[...]
MySQL said:
#1062 - Duplicate entry '3' for key 1

I had to split the exports up because it was too large to do in one shot. I am not very good at the database/sql stuff, but, I hope I am doing it right.

My steps so far:
backup of site and database to my pc.

created new database and installed new version into its own folder :

shop/ (OLD)

shop-new (new)

changed the configure files in the new folder to point to new database.
I am now importing files into the new database... and keep getting errors. I Am only half way through the entire database since it is so large.

Any help/insight will be appreciated. I have several sites to do and this is my first one, sure hope they all dont flow this way.

17 Sep 2009, 3:19 PM
#2
kobra avatar

kobra

Black Belt

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

Re: SQL Errors when importing to new database - #1062 - Duplicate entry '3' for key 1

Are you starting with a proper DB Backup???

https://www.zen-cart.com/tutorials/index.php?article=103

17 Sep 2009, 5:04 PM
#3
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: SQL Errors when importing to new database - #1062 - Duplicate entry '3' for key 1

Im not sure on that. What I did was export the old database to notepad and have been copying those files to the new database?

17 Sep 2009, 8:43 PM
#4
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: SQL Errors when importing to new database - #1062 - Duplicate entry '3' for key 1

That was the problem. I had followed another set of instructions and it didnt work. Followed those and it went well. Thank you! I have a couple small issues to work out and I will be ready to switch it over. Thanks again!