Support (offered by community volunteers) > Upgrading CiviCRM

1.6 > 1.7 database upgrade

<< < (2/3) > >>

Neil Adair:
Yes, I figured out they were from an earlier attempt, dropped the db and recreated.
Everything goes well until I import the data after dumping and reloading the database.

I get this error during the import
ERROR 1062 (23000) at line 103: Duplicate entry '812299607' for key 2

And I get the familiar non-recoverable error caused by a foreign key constraint failure. It's our webadmin email address!

I went looking and there are 3 Individuals in our db with that email, one is correct. I have no idea how the others came to have it but have cleared them. I'll try again with tonights backup tomorrow.

Thanks

fen:
I've got a similar problem, it seems: upgrading from 1.6 > 1.7:

When I try to load the dumped data from the upgraded 1.6 DB into the clean 1.7 structure, I get:


--- Code: ---ERROR 1062 (23000) at line 117: Duplicate entry '1' for key 2
--- End code ---

Line 117 is


--- Code: ---INSERT INTO `civicrm_contact` (`id`, `domain_id`, `contact_type`, ...
--- End code ---

Is this a foreign key problem?  (I seem to remember having a similar problem some time ago with the solution being to turn off a foreign key check on import, but I'm not sure.  I'll continue trying things and will report back if I find anything useful.)

Thanks.

Piotr Szotkowski:

--- Quote from: fen on August 16, 2007, 07:07:13 pm ---When I try to load the dumped data from the upgraded 1.6 DB into the clean 1.7 structure, I get:


--- Code: ---ERROR 1062 (23000) at line 117: Duplicate entry '1' for key 2
--- End code ---

Line 117 is


--- Code: ---INSERT INTO `civicrm_contact` (`id`, `domain_id`, `contact_type`, ...
--- End code ---

--- End quote ---

My guess is that either you’re trying to load the data into something more than just the structure or the dumped data is inconsistent – i.e., contains two civicrm_contact entries with the same value of 1 for either the external_identifier column or the id column.


--- Quote from: fen on August 16, 2007, 07:07:13 pm ---Is this a foreign key problem?

--- End quote ---

The error suggests the dump (or the attempt to load it, but more probably the dump in itself) breaks a UNIQUE key, so first check whether you don’t have two contacts with external_identifier of 1 in the dumped civicrm_contact table.

fen:
Thanks, Piotr - that appears to be it.  There are 15 sets of civicrm_contact reciords that have duplicate external_identifier values.

I'm editing them manually, but I wonder: might this column be a bit like the civicrm_uf_match table in that it could be NULLed out and it would re-create if/when necessary?

Thanks again!

Piotr Szotkowski:
I’m pretty sure that this column is for holding contact identifiers when the contacts are imported from some external source (like another CRM or some set of data) and there’s a need to keep the key they were identified in that other system for some reason.

I’m not quite sure on how would you recreate this data once it’s NULLed out…

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version