WordPress.org

Forums

[resolved] WP1.5 to WP2.1 upgrade fixes (1 post)

  1. Chris Burgess
    Member
    Posted 8 years ago #

    I upgraded a WP1.5 to WP2.1 recently, and had to make some manual fixes to the DB to make it behave afterwards. The upgrade script missed a few META values (on users at least) and I had no static pages after the upgrade.

    Here are the fixes I applied:

    No Static Pages

    http://wordpress.org/support/topic/102638

    Filosofo recommends here doing,
    UPDATE wp_posts SET post_type = 'page' WHERE post_status = 'static';. This worked for me.

    No rights to log in

    This would suck if you didn't have DB access. I had a spare DB to copy my rights from, luckily. So I did,
    INSERT INTO wp_usermeta ( user_id, meta_key, meta_value ) VALUES ( 1, 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}' );

    That assumes you're assigning the rights to user ID #1!

    No comment counts

    I used a temporary table to calculate and insert them.

    create table comment_counter ( post_ID int unsigned, cc int unsigned ) ;
    insert into comment_counter ( post_ID, cc ) select wp_posts.ID, count(wp_comments.comment_ID) from wp_posts, wp_comments where wp_posts.ID = wp_comments.comment_post_ID group by wp_comments.comment_post_ID ;
    update wp_posts, comment_counter set wp_posts.comment_count = comment_counter.cc where wp_posts.ID = comment_counter.post_ID ;
    drop table comment_counter ;

    Users all post as "Anonymous"/no Display Names set

    Manual update worked for me. I only updated the user_idmode values I had set - do SELECT DISTINCT user_idmode FROM wp_users to check if you have some idmode values I didn't here.

    SELECT DISTINCT user_idmode FROM wp_USERS
    update wp_users set display_name = nickname where user_idmode = 'nickname' ;
    update wp_users set display_name = user_firstname where user_idmode = 'firstname' ;
    update wp_users set display_name = concat(user_firstname, ' ', user_lastname) where user_idmode = 'namefl' ;
    update wp_users set display_name = user_login where user_idmode = 'login' ;

Topic Closed

This topic has been closed to new replies.

About this Topic