This Help forum is for issues relates to the latest release (1.7.10/11). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."

TOPIC: [SOLVED] Error importing a GEDCOM file

Error importing a GEDCOM file 2 months 6 days ago #1

  • Alex
  • Alex's Avatar
  • Offline
  • New
  • Posts: 45
Hi all,

I was importing a GEDCOM file to an existing tree (thus replacing all existing content) and I get this error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4-M1' for key 'PRIMARY'

Does anyone know why?

Thanks,
Alex
tree.cavazos.cc
webtrees 1.7.9 | Ubuntu 16.04 LTS | Apache 2.4 | PHP 7.0.22 | MySQL 5.7.19
The administrator has disabled public write access.

Error importing a GEDCOM file 2 months 5 days ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10500
It means that you are trying to import two records with the same unique identifier "M1".

The most common cause is that you have a GEDCOM file that contains two records "M1" (or "M1" and "m1").

Open the GEDCOM file with a text editor, and search for a line
0 @M1@ OBJE


Do you have more than one of these? If so, delete one of them. i.e. delete this line, and the following lines that begin with 1,2,3,4,5.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Error importing a GEDCOM file 2 months 5 days ago #3

  • Alex
  • Alex's Avatar
  • Offline
  • New
  • Posts: 45
Thanks Greg,

I didn't find more than one 0 @M1@ in the gedcom file.

question: when you import a gedcom to an existing tree, does it replace the existing gedcom, or adds to it? I'm thinking this could be the problem because I double checked and there are no repeats.

FYI, I used an excel tool to read the gedcom and assign new INDI numbers, mine are all messed up since I've migrated from GRAMPS. The resulting renumbered gedcom I was able to import it into a new tree just fine. After I checked the new tree and found no issue I trued to import this new gedcom into my existing tree and that's when the error occurred. For now I restored a MySQL backup I did before doing all this and the site is working fine, but I wanted to know if the import overwrites or appends.

Regards,
Alex
tree.cavazos.cc
webtrees 1.7.9 | Ubuntu 16.04 LTS | Apache 2.4 | PHP 7.0.22 | MySQL 5.7.19
The administrator has disabled public write access.

Error importing a GEDCOM file 2 months 5 days ago #4

  • bertkoor
  • bertkoor's Avatar
  • Offline
  • Gold
  • Greetings from Utrecht, Holland
  • Posts: 1454
Import always overwrites. It says so in the dialog.

Exception: keep media objects. Do NOT tick that box. This also is an option causing more damage than benefit for a very small group.

You could try importing in a fresh new tree, just to check the integrity of your gedcom file.
stamboom.BertKoor.nl runs on webtrees v1.7.9
Last Edit: 2 months 5 days ago by bertkoor.
The administrator has disabled public write access.

[SOLVED] Error importing a GEDCOM file 2 months 3 days ago #5

  • Alex
  • Alex's Avatar
  • Offline
  • New
  • Posts: 45
Problem solved.
tree.cavazos.cc
webtrees 1.7.9 | Ubuntu 16.04 LTS | Apache 2.4 | PHP 7.0.22 | MySQL 5.7.19
The administrator has disabled public write access.
Powered by Kunena Forum