Support » Fixing WordPress » Upgrade loop in admin from duplicate wp_terms

  • Since my upgrade from 2.2 to 2.3, I cannot access my dashboard as I am stuck on the upgrade.php page asking to update the database.

    I do so and I get this kind of error :
    WordPress database error: [Duplicate entry ‘1’ for key 1]
    INSERT INTO wp_terms (term_id, name, slug, term_group) VALUES (‘1’, ‘Junkyard’, ‘general-2’, ‘1’)


    My blog has been updated, but I have lost all my categories. Any idea how to get past step 1 in the upgrade process ?

Viewing 9 replies - 1 through 9 (of 9 total)
  • I can bypass by commenting these lines in wp-admin/admin.php

    if ( get_option('db_version') != $wp_db_version ) {
    	wp_redirect(get_option('siteurl') . '/wp-admin/upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI'])));

    But my table wp_term_relationships is not populated 🙁

    Then your upgrade wasn’t successful…

    How can I get the upgrade to get past step 1 ?

    I need to cancel the duplicate insertions in wp_terms and wp_term_taxonomy so as to continue with insertions in wp_term_relationships

    I am really lost… as you could see in that other thread not even one of the Lead Developers could reproduce the error or figure out what was the reason for it. I don’t know what to advise, sorry.

    My original blog was under Dotclear 1.2, before importing into WordPress 2.2.2

    ryan, any idea ?

    May be:

    INSERT INTO wp_terms (term_id, name, slug, term_group) VALUES (‘9999999’, ‘Junkyard’, ‘general-2’, ‘1’)

    BorisMsk : I don’t see what changes that does.

    Note: I was having the same problem. If you just keep pressing the upgrade button it will continue where it left off and eventually it will finish.

    I think the problem is that those errors make the script take a long time to finish, and if you have a shitty server (my shitty server is run by then you end up wasting your 30 second limit and the script just stops, so you have to manually restart it.

    My problem now is that once the whole thing is finished my term_relationships are all fucked up and months worth are missing.

    One solution I found was to export my DB using phpmyadmin, upgrade it inside a local wp install on my laptop (i use MAMP on mac, XAMPP is the same thing on windows), which only took like 1 second instead of 2 mintues. Then I just exported the database and imported it back into my original db. Not very efficient and pretty dangerous but stuck is stuck.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Upgrade loop in admin from duplicate wp_terms’ is closed to new replies.