Not sure how duplicate entry id’s could exist, but I got the following on an attempt to upgrade from 1.7.3 to 2.5.2.
A Database Error Occurred
Error Number: 1062
Duplicate entry ‘97’ for key 1
ALTER TABLE `exp_weblog_data` ADD PRIMARY KEY `entry_id` (`entry_id`)
Filename: updates/ud_200.php
Line Number: 1693
EngineHosting support said:
The update script is not trying to add a record that already exists. It is performing a schema change by actually altering the table itself with the,
ALTER TABLE `exp_weblog_data` ADD PRIMARY KEY `entry_id` (`entry_id`)
sql command. It is impossible to add a duplicate primary key to that table. EllisLab should have written a catch case for when this occurs during a previously failed update and check to see if the table already has the primary key set and if so, to not run the alter table command.
You might submit this occurrence to EllisLab ExpressionEngine.com as a bug since this condition should be detected and action taken based on it to continue with the upgrade.
I tried manually going through the exp_weblog_data table and changing the duplicate id’s but I got another error so I rolled back. Please advise.