ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Upgrade to EE2 failing due to Duplicate entry_id

August 06, 2012 1:12pm

Subscribe [2]
  • #1 / Aug 06, 2012 1:12pm

    bree

    19 posts

    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.

     

  • #2 / Aug 08, 2012 10:28am

    Shane Eckert

    7174 posts

    Hell bree,

    I am sorry to hear you are running into this problem.

    The duplicate ID will most often occur if you are attempting a second upgrade after the first has failed. To recover from this you will need to roll back and follow this guide.

    Be sure to use a known good DB, not one that has been through a failed upgrade.

    I hope this helps.

    Thank you,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases