Forums / Upgrading to 1.5.x / upgrading from 139h tp 1.5.1 error #1062 - Duplicate entry '1' for key 'PRIMARY'

upgrading from 139h tp 1.5.1 error #1062 - Duplicate entry '1' for key 'PRIMARY'

Started by derek_bryant on 31 Oct 2012, 9:20 AM · Views: 1,201

Results 1 to 4 of 4
31 Oct 2012, 9:20 AM
#1
derek_bryant avatar

derek_bryant

Zen Follower

Join Date:
Jul 2008
Location:
Bristol UK
Posts:
162
Plugin Contributions:
0

upgrading from 139h tp 1.5.1 error #1062 - Duplicate entry '1' for key 'PRIMARY'

Hi

I get the above error message along with:

SQL query:

--
-- Dumping data for table address_format

INSERT INTO address_format ( address_format_id , address_format , address_summary )
VALUES ( 1, '$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city / $country' ) , ( 2, '$firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country', '$city, $state / $country' ) , ( 3, '$firstname $lastname$cr$streets$cr$city$cr$postcode - $statecomma$country', '$state / $country' ) , ( 4, '$firstname $lastname$cr$streets$cr$city ($postcode)$cr$country', '$postcode / $country' ) , ( 5, '$firstname $lastname$cr$streets$cr$postcode $city$cr$country', '$city / $country' ) , ( 6, '$firstname $lastname$cr$streets$cr$city$cr$state$cr$postcode$cr$country', '$postcode / $country' ) ;

MySQL said:

#1062 - Duplicate entry '1' for key 'PRIMARY'

I have installed a fresh copy of version 1.5.1. in a subdirectory
Run the installer
Exported the sql database file from the 1.39h version
Imported this file into my new 1.5.1 database
which gives the above errot message

Please can anyone help?SQL query:

--
-- Dumping data for table address_format

INSERT INTO address_format ( address_format_id , address_format , address_summary )
VALUES ( 1, '$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city / $country' ) , ( 2, '$firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country', '$city, $state / $country' ) , ( 3, '$firstname $lastname$cr$streets$cr$city$cr$postcode - $statecomma$country', '$state / $country' ) , ( 4, '$firstname $lastname$cr$streets$cr$city ($postcode)$cr$country', '$postcode / $country' ) , ( 5, '$firstname $lastname$cr$streets$cr$postcode $city$cr$country', '$city / $country' ) , ( 6, '$firstname $lastname$cr$streets$cr$city$cr$state$cr$postcode$cr$country', '$postcode / $country' ) ;

MySQL said:

#1062 - Duplicate entry '1' for key 'PRIMARY'

Derek:(

31 Oct 2012, 2:45 PM
#3
derek_bryant avatar

derek_bryant

Zen Follower

Join Date:
Jul 2008
Location:
Bristol UK
Posts:
162
Plugin Contributions:
0

Re: upgrading from 139h tp 1.5.1 error #1062 - Duplicate entry '1' for key 'PRIMARY'

Many thanks Kobra - that's cracked it!:smile:

I did waste quite a bit of time searching past similar threads
the "Welcome to Zen Cart" installation guide doesn't seem to cover this area unless it has recently been updated:(

Derek

7 Nov 2012, 4:36 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: upgrading from 139h tp 1.5.1 error #1062 - Duplicate entry '1' for key 'PRIMARY'

It's covered in the FAQ on making database backups: http://www.zen-cart.com/content.php?144-how-can-i-do-a-site-backup-or-use-phpmyadmin-for-database-backup
-- note the options to check, which includes "include DROP TABLE ..."

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