Zen Cart Logo
Forums / Upgrading to 1.5.x / Error importing old database to the new database

Error importing old database to the new database

Views: 2,340

Results 1 to 2 of 2
3 Jan 2012, 6:01 AM
#1
wmorris avatar

wmorris

Totally Zenned

Join Date:
Aug 2007
Location:
Amarillo, Tx
Posts:
1,682
Plugin Contributions:
0

Error importing old database to the new database

after I install the new version to the new database.

I import the old database to the new database I got this error:

Error
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'

3 Jan 2012, 7:27 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Error importing old database to the new database

When you made your backup you didn't include the option to "DROP TABLES" as part of your settings.
Thus, your import is attempting to duplicate the entries already in the database.

From the Tutorials:
3. On your OLD host, Make a COMPLETE backup of your DATABASE and STORE.
a. Use either the "Backup MySQL Database" contribution to do the backup of your database, or use phpMyAdmin to export your entire database ... include the "DROP" tables command, and under Data, choose "Complete Inserts" and "Extended Inserts".
Save the SQL file to your PC for later.
Click here for tips on using phpMyAdmin to export database.