• I was upgrading from WP2.3 to WP2.8.1 using WP Automatic Upgrade plugin.

    Everything went well until I got the WP “Database Upgrade Required” screen. Clicked on “Upgrade WordPress Database” and encountered a number of duplicate entry errors for INSERT commands into the “wp_terms” and “wp_term_taxonomy” tables. Example:

    WordPress database error: [Duplicate entry ‘1’ for key 1]
    INSERT INTO wp_terms (term_id, name, slug, term_group) VALUES
    (1,’Discounts’, ‘discounts-2’, 1)

    Browsing the tables in phpMyAdmin, I see that the rows have been inserted which explains the duplication errors so I emptied both tables and ran the upgrade again. Got a blank screen and when I browse back to \wp-admin\ I get redirected to the “Database Upgrade Required” page again.

    Browsing my site, looks like the site content is all there there except the categories but now I’m basically locked out of admin.

    Any help is much appreciated!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter petrcetera

    (@petrcetera)

    Also tried manually disabling all plugins to no avail…

    Do you have a backup of the database from BEFORE you started all of this?

    Youre going to to have one hell of a time sorting through duplicate entry/duplicate key errors, if not.

    Thread Starter petrcetera

    (@petrcetera)

    yes, backed up DB and files. I tried restoring the DB on clean local WP install for WP2.3 and WP2.8 and got the same errors.

    Is there a way for me to bypass content inserts into both those tables? Don’t mind manually re-inserting those rows if I have to as I don’t have a lot of categories.

    yes, backed up DB and files. I tried restoring the DB on clean local WP install for WP2.3 and WP2.8 and got the same errors.

    wrong.

    firstly, a backup of database tables that wasnt throwing those errors, wont magically start erroring, if imported properly into a clean database.
    so ..

    secondly, you cannot import database tables for a 2.3.x install into a fresh 2.8.x database. the schemas are not the same — (thats the purpose of the “your database needs to be upgrade” button — to make those changes from version to version)

    heres what you do, assuming you have a 2.3.x backup PRE-upgrade, and backup of your files PRE-UPGRADE

    1. remove everything related to this wordpress blog from your web space.

    2. remove the screwed up tables inside that database. DONT delete the database — just the tables within. The phmyadmin “thing” you want to do iS called a “Drop”.

    3. Upload a CLEAN install of wordpress that is the same version as the one you were using PRE-Upgrade. you can get older versions of WP here:

    http://ww.wp.xz.cn/download/release-archive/

    4. Take the wp-config.php that is from your backed up files, and use that config for the new install.

    5. Once you have installed that brand new WP —

    6. Delete all the WP files except your wp-config.php that you just uploaded.

    6-1/2: Upload your backed files from PRE-Upgrade.

    7. Go back into phpmyadmin and redo step 2 above — you want to drop all the tables in the new database.

    8. While still in phpmyadmin, import the PRE-upgrade backup.

    steps 6-1/2 and 8 put back everything to how it was before you upgraded. do NOT concern yourself with errors that you might see in between those 2 steps. Just keep going — dont try to deactivate this, activate that, login, etc..

    This can be done differently, but THIS way is the way it will nearly always work.

    then do a manual upgrade.

    Thread Starter petrcetera

    (@petrcetera)

    Followed your steps but still got the same errors. Seems like the file backups backed up the 2.8 version so I got the upgrade DB loop again. However, I think I have this sorted out.

    Here’s what I did:

    1) Clean install of WP2.3
    2) Emptied most tables (comments, links, posts, terms*) of default content
    3) Imported data fr my DB backup
    4) Refreshed \wp-admin – for some reason I get the DB upgrade message but this time it completed successfully as its 2.3 to 2.3
    5) Upgraded to WP2.8

    Thanks very much for your pointers!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘stuck in database upgrade mode (PLEASE HELP!)’ is closed to new replies.