The MU forums have moved to WordPress.org

1.5.1 Upgrade Site doesn't update DB tables or blog versions? (5 posts)

  1. dgilmour
    Member
    Posted 15 years ago #

    I'd appreciate advice on why Upgrade Site might not be working properly, and best course of action.

    Following upgrade from 1.3.3 to 1.5.1 Upgrade Site appeared to run OK, but comments on pre-upgrade blogs don't appear under Site Admin/Comments, except for on the home blog. The number awaiting moderation is displayed, but that's all. They do appear for post-upgrade blogs.

    Upgrade Site hasn't made some needed database changes. Pre-upgrade blogs have only two alternate keys in the wp_<id>_comments table; comment_approved and comment_post_ID. Post-upgrade blogs have two more; comment_approved_date_gmt and comment_date_gmt.

    Trying again hasn't helped. All plugin files were removed during upgrade.

    Also, table wp_blog_versions contains db_version values of 6125 for every blog (I upped the number from 6124 at some stage during 1.3.3 upgrade). It doesn't have entries for recent blogs (highest ID is currently 1094, but table doesn't contain values over 980). Sampling wp_<id>_options tables shows db_version is 6125 there too.

    version.php is standard:
    $wp_version = '2.5.1';
    $wp_db_version = 7796;
    $wpmu_version = '1.5.1';
    Site is a subdirectory install and environment is Apache 2.0.55, Ubuntu, PHP V5.1.2 using CGI/1.1, My SQL 5.0.22

    The database was created with WPMU 1.0RC4, and was using latin1 encoding which I changed to utf8 months after the upgrade. Apart from the Manage Comments issue, everything is working fine.

    Usual advice on forcing an upgrade relies on upping the db_version in version.php to a higher value than that in the database - but it already is.

    Similar symptoms have been discussed in a forum thread. That suggests changing the database tables, but that wouldn't give me confidence that something else hadn't been missed, or get db_version corectly set.

    Thanks for taking the time to read this.

  2. webmaestro
    Member
    Posted 15 years ago #

    I had the same problem. It was apparently a bug in wpmu-1.5.1 when upgrading from wpmu-1.3.1.

    The fix is to CREATE an INDEX on the 'comment_gmt' column in the 'wp_XXX_comments' table.

    IMPORTANT: MAKE A BACKUP OF YOUR DATABASE FIRST

    If you don't have too many tables, you could run the following command on each table, replacing wp_XXX_comments with each blog's comments table:

    Single Blog Version

    CREATE INDEX comment_date_gmt_idx
      USING BTREE
      ON wpmu.wp_XXX_comments(comment_date_gmt DESC);

    (replace XXX with each blogid)

    Or, you could run the following script, replacing both instances of [USER] with your WPMU database username, [PASS] with its corresponding password, and [DB] with the corresponding WPMU database name:

    Multi-Pass Version

    #!/bin/bash
    
    for id in ^/web/mysql/bin/mysql -u[USER] -p[PASS] [DB] -Bse "select blog_id from wp_blogs order by blog_id"^ ; do
    tables="wp_"$id"_comments"
    sql="CREATE INDEX comment_date_gmt_idx USING BTREE ON wpmu."$tables"(comment_date_gmt DESC);"
    /web/mysql/bin/mysql -u[USER] -p[PASS] [DB] -Bse "$sql"
    done

    IMPORTANT: Replace both ^ marks with backticks!!! The WordPressMU Forum uses backticks (to the left of the number 1 on the U.S. keyboard) as a 'code' formatting delimiter, so I had to improvise.

    I ran the single version once on wp_35_comments (one of my test blogs), before running the script on the whole database (so when I ran the script, I got an error that wp_35_comments already had the index set ;-)).

  3. dgilmour
    Member
    Posted 15 years ago #

    Thanks, webmaestro, for your prompt help and for sharing the scripts. It's reassuring to know it's a known bug. I'll give it a try and post what I learn.

  4. MrBrian
    Member
    Posted 15 years ago #

    I had the same problem sometime back and made a trac ticket, it has solution in it:

    http://trac.mu.wordpress.org/ticket/704

  5. dgilmour
    Member
    Posted 15 years ago #

    Thanks MrBrian, but I don't think it's quite the same. My install is subdirectory, not subdomain, so there's not the same need for the Snoopy class to connect to nonexistent domain names used in WPMU like "theblogname.thedomain.com".

    It looks like this is one that's carried over from WPSU:
    http://wordpress.org/support/topic/167450?replies=22

About this Topic

  • Started 15 years ago by dgilmour
  • Latest reply from dgilmour