WordPress.org

Ready to get started?Download WordPress

Forums

wp_terms' doesn't exist ERROR upgrading to 2.3 (24 posts)

  1. alex25
    Member
    Posted 6 years ago #

    I recently upgraded to latest version and categories and archieves dissapeared. Let me say that I had posts in more that one category. On my page I have this error several times:

    (just a note: mainsite = username , mysite = my site address)

    WordPress database error: [Table 'mainsite.wp_terms' doesn't exist]
    SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (171) ORDER BY t.name ASC

    If I try to edit a post and save I have this error:

    WordPress database error: [Table 'mainsite.wp_terms' doesn't exist]
    SELECT t.term_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (166) ORDER BY t.name ASC

    WordPress database error: [Table 'mainsite.wp_terms' doesn't exist]
    SELECT t.name FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('post_tag') AND tr.object_id IN (166) ORDER BY t.name ASC

    WordPress database error: [Table 'mainsite.wp_term_relationships' doesn't exist]
    SELECT tr.term_taxonomy_id FROM wp_term_relationships AS tr INNER JOIN wp_term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN (166) AND tt.taxonomy IN ('category') ORDER BY tr.term_taxonomy_id ASC

    WordPress database error: [Table 'mainsite.wp_terms' doesn't exist]
    SELECT term_id FROM wp_terms as t WHERE t.term_id = '1'

    WordPress database error: [Table 'mainsite.wp_terms' doesn't exist]
    SELECT term_id FROM wp_terms as t WHERE t.slug = '1'

    WordPress database error: [Table 'mainsite.wp_terms' doesn't exist]
    INSERT INTO wp_terms (name, slug, term_group) VALUES ('1', '1', '0')

    WordPress database error: [Table 'mainsite.wp_term_taxonomy' doesn't exist]
    SELECT tt.term_taxonomy_id FROM wp_term_taxonomy AS tt INNER JOIN wp_terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = 'category' AND t.term_id = 0

    WordPress database error: [Table 'mainsite.wp_term_taxonomy' doesn't exist]
    INSERT INTO wp_term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('0', 'category', '', '0', '0')

    WordPress database error: [Table 'mainsite.wp_term_relationships' doesn't exist]
    SELECT term_taxonomy_id FROM wp_term_relationships WHERE object_id = '166' AND term_taxonomy_id = '0'

    WordPress database error: [Table 'mainsite.wp_term_relationships' doesn't exist]
    INSERT INTO wp_term_relationships (object_id, term_taxonomy_id) VALUES ('166', '0')

    WordPress database error: [Table 'mainsite.wp_term_relationships' doesn't exist]
    SELECT COUNT(*) FROM wp_term_relationships, wp_posts WHERE wp_posts.ID = wp_term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = '0'

    WordPress database error: [Table 'mainsite.wp_term_taxonomy' doesn't exist]
    UPDATE wp_term_taxonomy SET count = '' WHERE term_taxonomy_id = '0'

    WordPress database error: [Table 'mainsite.wp_term_taxonomy' doesn't exist]
    SELECT term_id, taxonomy FROM wp_term_taxonomy WHERE term_taxonomy_id IN (0)

    WordPress database error: [Table 'mainsite.wp_term_relationships' doesn't exist]
    SELECT tr.term_taxonomy_id FROM wp_term_relationships AS tr INNER JOIN wp_term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tr.object_id IN (166) AND tt.taxonomy IN ('post_tag') ORDER BY tr.term_taxonomy_id ASC

    WordPress database error: [Table 'mainsite.wp_terms' doesn't exist]
    INSERT INTO wp_terms (name, slug, term_group) VALUES ('', '', '0')

    WordPress database error: [Table 'mainsite.wp_terms' doesn't exist]
    UPDATE wp_terms SET slug = '0' WHERE term_id = '0'

    WordPress database error: [Table 'mainsite.wp_term_taxonomy' doesn't exist]
    SELECT tt.term_taxonomy_id FROM wp_term_taxonomy AS tt INNER JOIN wp_terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = 'post_tag' AND t.term_id = 0

    WordPress database error: [Table 'mainsite.wp_term_taxonomy' doesn't exist]
    INSERT INTO wp_term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('0', 'post_tag', '', '0', '0')

    WordPress database error: [Table 'mainsite.wp_term_relationships' doesn't exist]
    SELECT term_taxonomy_id FROM wp_term_relationships WHERE object_id = '166' AND term_taxonomy_id = '0'

    WordPress database error: [Table 'mainsite.wp_term_relationships' doesn't exist]
    INSERT INTO wp_term_relationships (object_id, term_taxonomy_id) VALUES ('166', '0')

    WordPress database error: [Table 'mainsite.wp_term_relationships' doesn't exist]
    SELECT COUNT(*) FROM wp_term_relationships, wp_posts WHERE wp_posts.ID = wp_term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = '0'

    WordPress database error: [Table 'mainsite.wp_term_taxonomy' doesn't exist]
    UPDATE wp_term_taxonomy SET count = '' WHERE term_taxonomy_id = '0'

    WordPress database error: [Table 'mainsite.wp_term_taxonomy' doesn't exist]
    SELECT term_id, taxonomy FROM wp_term_taxonomy WHERE term_taxonomy_id IN (0)

    Warning: Cannot modify header information - headers already sent by (output started at /var/www/virtual/mysite.net/htdocs/wp-includes/wp-db.php:160) in /var/www/virtual/mysite.net/htdocs/wp-includes/pluggable.php on line 390

    If I change the theme and deactivate all the plugins I have the same error, it`s not from a plugin. PLEASE HELP. Thanks!

  2. Lester Chan
    Member
    Posted 6 years ago #

    did u run upgrade.php?

  3. alex25
    Member
    Posted 6 years ago #

    Of course I did! Don`t know what to do :(

  4. alex25
    Member
    Posted 6 years ago #

    Any ideas?

  5. MichaelH
    Member
    Posted 6 years ago #

    Try running the upgrade.php again. If that doesn't work, force a database update. If that doesn't work, I'd be tempted to drop all the tables in your database and restore your database backup before doing the upgrade again.

  6. alex25
    Member
    Posted 6 years ago #

    I forced that DB update and it worked (no errors now). Thanks!

    Still, all my categories dissapeared and now all my posts are "uncategorized". In "Manage" -> "Categories" from the admin menu I have no categories :(

    Can I get them back somehow or I`ve lost all of them? :(

  7. MichaelH
    Member
    Posted 6 years ago #

    One ugly possibility--
    Backup your database.
    Drop the table.
    Restore your database to pre-2.3 upgrade.
    Redo the upgrade.

  8. alex25
    Member
    Posted 6 years ago #

    I exported the DB from SQL Admin but I dont know if thats a good thing to do. Is there any way to see in the exported DB file is there is one or more categories before I do that? (because it could be useless)

    And what table should I drop?

  9. MichaelH
    Member
    Posted 6 years ago #

    Usually you can use a Text editor to look at the sql export.

    I'm suggesting dropping all the WordPress tables before you restore.

  10. alex25
    Member
    Posted 6 years ago #

    Done, but its still no use. No upgrade needed after I restored, I forced again the upgrade and <strong>still no categories</strong>. I dont know what happened with my categories :( I had like 10-15 and now are gone :(

  11. Dion Hulse
    WordPress Dev
    Posted 6 years ago #

    If for some reason your terms table wasnt created during the upgrade proceedure, then the following queries to move categories from your old table to the new table would've failed.
    It seems that WP doesnt reconise that an error occcured (And i wouldnt have a clue why the table creation failed unless the mysql user didnt have create privledges) and then continues to delete the old category tables (as it expected them to be transfered to the new table)

    So, If the wp_Category tables dont exist still, and you didnt backup your database before doing the upgrade, you're just going to have to re-categorise, (and might as well tag everything too).

  12. alex25
    Member
    Posted 6 years ago #

    Im creating again the categories, it will take some time to edit the posts and stuff.... but its the only solution. Thanks for all the help but, in my opinion, wordpress 2.3 should have been tested much more. The released was rushed, with many bugs - despite of the beta ones. Things go on...

  13. foolswisdom
    Moderator
    Posted 6 years ago #

    Tested much more by whom? Did you test it?

    This sounds like a very frustrating situation, and I take it you don't have a backup of your database from *before* upgrading? Or an export in the WordPress WXR format?

    Without a backup of your database from before, I don't see how we can help diagnose your problem further.

  14. Mark Jaquith
    WordPress Lead Dev
    Posted 6 years ago #

    Is it possible that you don't have the CREATE MySQL priv?

  15. George
    Member
    Posted 6 years ago #

    I had the same problem, indeed WP did not recognize the faulty conversion.
    http://wordpress.org/support/topic/135680?replies=3#post-621125

  16. Flower2Girl
    Member
    Posted 6 years ago #

    I had the same database error(something with siteblog_wpterms does noet exist), I called up the upgrade.php file... I thought that was missing, because usuallly after an upgrade you get the upgrade database page, but I didn't get it this time.

    So I guess that the people who didn't get that page after upgrading, should call up the page themselves. After that everything worked fine.

  17. TechKido
    Member
    Posted 6 years ago #

    I had a similar problem. It seemed that I did not have all my plugins disabled when I used the upgrade script. I lost all my categories like you did.

  18. whimboo
    Member
    Posted 6 years ago #

    I wrote a post about this issue and how to solve it on my blog: http://www.hskupin.info/2007/09/27/upgrade-to-wordpress-23/

  19. SavageDem
    Member
    Posted 6 years ago #

    Alright, I've tried (I believe) everything listed here. I can successfully rollback my DB and blog to prior version 2.0, and I've ensured that all add-ons are turned off. Every time I run the upgrade script (after restoring), I see the same symptom as above - wp_terms not defined. I've tried to force a DB change, and that's where it seems something is not occurring correctly: my original db_version is 3308. No matter if I run the upgrade or manually update db_version on the DB to a different value (like 3441), it never gets set to the "new" 2.3 version of 6124 when running the upgrade.

    I notice that 3308 is not listed on the list of "standard" WordPress releases for db_version values. Do I have a pre-release, or beta version of 2.0, and is that possibly keeping the update script from operating correctly?

    If so, would manually creating the wp_terms et al tables help me out? Can anyone out there grab the Create SQL for the three new tables off of a backup of a 2.3 DB and post it here?

  20. SavageDem
    Member
    Posted 6 years ago #

    I'm back again, and this time with a tale of success. My operating theory is still that the upgrade script somehow was confused by the version number on my DB (which was 3308) - I'm guessing that my prior WordPress version was a pre-official 2.0 release, as 3308 isn't listed in the entries I've seen as one of the standard values.

    Anyway...after being frustrated, restoring many times, attempting to upgrade many times, I did this:

    1. Restored to prior working version - both DB and WordPress files
    2. Logged out of Admin on my blog and made sure all plug-ins disabled
    3. Deleted all WordPress 2.0 files on my server using FileZilla
    4. Copied all WordPress 2.3 files to the server (including new wp_config containing several new variables)
    5. Went into phpMyAdmin and updated db_version in wp_options table from 3308 to 3441 (which should indicate WordPress 2.0)
    6. Navigated to my blog. It appeared screwy, but I was able to utilize the Admin link to login
    7. Once logged in, the "Your database is out of date and must be updated" message was displayed. I then used the link shown to upgrade the DB.
    8. Voila'! Everything is up!

    I probably could have used the upgrade.php script, but had tried that several times before with no success. I really think the key here was changing the value of db_version to 3441 prior to trying the DB upgrade the first time. If I ran the upgrade script with a db_version of 3308, the forced DB upgrade would never work after that - no matter what I changed the value of db_version to.

  21. SavageDem
    Member
    Posted 6 years ago #

    One last thing: after upgrading I was seeing a number of special characters in unusual places in my existing posts. After looking through the forums a bit, I realized that I the additions I had made to wp_config were causing the problem. Specifically, do NOT add the following to your wp_config for a DB upgrade:

    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    Over and out.

  22. ronnieroller
    Member
    Posted 6 years ago #

    I just delete my cache from WP-Cache and everything worked fine after that.

  23. 4midori
    Member
    Posted 6 years ago #

    Hi,

    I found this issue extremely annoying. However, I realize I had forgotten to disable plugins. And the common plugin "Google Sitemap Generator" did not work with WordPress 2.3. I deactivated the plugin, rolled back the database as described, and replaced that plugin with the newest one. My install is happy now.

  24. Moominmama
    Member
    Posted 6 years ago #

    Thank you for your step by step post! I wouldn't have been able to fix things without it but this worked for me. The last two wordpress upgrades have been horrible -- I think I'm going to hang here for awhile at 2.3.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags