The MU forums have moved to WordPress.org

Dropping and reinstalling tables only for root blog (7 posts)

  1. r-a-y
    Member
    Posted 9 years ago #

    I've had an issue with term_id's and taxonomies for a while now.

    To read about my problem, see here:
    http://wordpress.org/support/topic/333023

    MichaelH over on the Wordpress forums suggested I drop the tables and reinstall the blog.

    The caveat is this problem only occurs on one of the blogs, which would be the root blog.

    How do I go about recreating these tables without reinstalling the rest of the blogs on my MU install?

    Is this even possible? If there's a better course of action for my problem (read the link I posted above), please let me know.

    Thanks for reading.

  2. andrea_r
    Moderator
    Posted 9 years ago #

    I would be more inclined to just recreate those tables within the database, not drop them all.

    you could, in theory, just drop the wp_1_whatever tables and not affect the rest of the install, but it's only the tags & categories affected.

    you can backup just those tables:
    wp_1_terms
    wp_1_term_taxonomies
    wp_1_term_relationships

    Then drop 'em.

    A nifty feature in phpmyadmin is the ability to copy tables as well, so make a test blog that's empty, then go in phpmyadmin and select the first terms table there, and under the Operations tab, tell it to copy it. It will ask for the table name of the new copy and just make it have _1_ in there.

    Standard disclaimers apply: I have no idea if this will work, but it may help clean something up. You'd have to recreate your tags & categories. You may only need to do the term_taxonomy table. PLEASE backup the entire db before you do anything else, just in case you click the delete all button by accident.

    It's definitely a puzzling issue though.

  3. r-a-y
    Member
    Posted 9 years ago #

    Okay I think I figured this out.

    Take a look at this screenshot again:
    http://i49.tinypic.com/xct9qs.jpg

    We did some digging and found out that the circled term_id's are actually the cat_ID from the wp_sitecategories table, instead of the term_id from the wp_1_terms table.

    So I was trying to figure out why the wp_sitecategories table was out of sync with the wp_1_terms table.

    ---

    Here's another part of the puzzle:

    The root blog is an imported blog from a regular Wordpress install done via PHPMyAdmin. I'm guessing MU never detected these terms, which is why our wp_sitecategories table is out of whack!

    ---

    Then I read this thread:
    http://mu.wordpress.org/forums/topic/4102

    Which had a similar problem to ours. He basically exported his posts in the Wordpress admin area, purged his current posts and reimported them, which correctly repopulated his wp_sitecategories table.

    I'm about to do the same, but was wondering if there was a better way for MU to detect the missing terms?

  4. r-a-y
    Member
    Posted 9 years ago #

    I'm just going to add some additional thoughts.

    Is there a reason MU looks at the wp_sitecategories table for tags, link categories and custom taxonomies instead of the wp_x_terms table?

    Should this be reported as a bug on Trac?

  5. r-a-y
    Member
    Posted 9 years ago #

    Okay I've resolved this issue by exporting the posts from the WP admin area, deleting all taxonomies (categories, tags, link categories, custom taxonomies) and then used WP's import function.

    Just have to re-adjust a few things due to category ID changes, but everything appears well with the WPMU cosmos again!

    ---

    Word of warning for those importing regular WP blogs via PHPMyAdmin / mySQL. Watch out for the wp_sitecategories table!

    Best to use Ron's Advanced Export plugin and re-import in the Wordpress admin area.

  6. andrea_r
    Moderator
    Posted 9 years ago #

    Well, I'm just glad that worked. :D

  7. andrea_r
    Moderator
    Posted 9 years ago #

    friggin' rain borkin' my internet...

About this Topic