WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Comments missing after upgrade and import (9 posts)

  1. bdayne
    Member
    Posted 6 years ago #

    After a fresh install of 2.6 I imported two different WP blogs. Prior to import I backed up and upgraded both blogs from 2.3.3 to 2.6. After import I noticed the missing categories, and permalinks issues that seem to accompany this upgrade. I also noticed errors in my comments display in admin.

    I've now dealt with the categories and permalinks issues, but the fix for the comments issue has totally eluded me, and I'm really hoping someone can help. A similar problem with missing comments after upgrade to 2.5 has been discussed, but the fix didn't work for me, probably because my problem is a little different than those described.

    In addition to the fix listed above, I tried repairing the database comments table, using WP-DBManager Plugin, which was clearly the wrong thing, as it turned what was essentially an admin display issue into a front end issue. Now the posts that were displaying comments, are no longer doing so.

    Today I tried running the import again, to pull in the most recent data from one of the blogs (the other hasn't been added to), and I was also hoping that maybe I could pull in the missing data with the import. Today's imported posts and comments are now displaying fine, but the missing comments issues remain with the older posts and comments.

    Here's what I'm seeing:

    • Imported posts dated prior to Feb 2008 show 0 comments in Manage Posts and Manage Comments under WP-admin. The comments balloon reads 0 on all posts. On the front end the category archive pages do list the number of comments, below the excerpt on the archives pages. When a single post page from the archive is viewed, however, there are no comments are displayed.
    • Imported posts dated after Feb 2008 do show comments under Manage Posts. The little comments balloon shows a number, but when you click the balloon to view the comments for that page, no comments are displayed.
    • Under Manage Comments I can see the comments from posts imported before today, but where it usually lists "From: post title, date, time" there are no posts associated with these comments. Some have a date associated, but no post title, while others have no post data associated at all. On the front end, the number of posts is visible for these posts on the category archives pages, but you can't see the comments when you view the posts.

    Finally, some of the fixes I've read would seem to indicate that much info may be gleaned from the apache error_log. I don't have access but have been in touch with my host and customer support at 1and1 says they can run one, and they will do so and email it to me.

    If there's something more I could do to find a fix for this, I don't know what it is, but I'm fairly sure someone here will be able to tell me. ;)

    Thanks!

  2. whooami
    Member
    Posted 6 years ago #

    Under Manage Comments I can see the comments from posts imported before today, but where it usually lists "From: post title, date, time" there are no posts associated with these comments. Some have a date associated, but no post title, while others have no post data associated at all. On the front end, the number of posts is visible for these posts on the category archives pages, but you can't see the comments when you view the posts.

    you need to make sure that all of the indexes have been created for the comments table inside MySQL. I discovered this during a recent upgrade, when comparing a brand new install to an upgraded one -- and it just recently been comming up on the forum elsewhere as well.

    http://wordpress.org/support/topic/164838?replies=14
    http://wordpress.org/support/topic/194835?replies=7
    http://wordpress.org/support/topic/167450?replies=24

  3. whooami
    Member
    Posted 6 years ago #

    to add to the above, the comments table has 5 indexes, one of which is the primary.

    PRIMARY KEY (comment_ID),
    KEY comment_approved (comment_approved),
    KEY comment_post_ID (comment_post_ID),
    KEY comment_approved_date_gmt (comment_approved,comment_date_gmt),
    KEY comment_date_gmt (comment_date_gmt)

    The most recent upgrade I did on a site was missing 2 of the indexes.

  4. bdayne
    Member
    Posted 6 years ago #

    Thanks very much for the speedy replay, whooami.

    Creating an index in that table is the fix I linked to above. I've tried it a couple of times in MySql, and I get the success message each time. When I check the blog, nothing has changed, and all the problems listed above still exist. I just don't understand why this fix isn't working for me, but it isn't.

  5. bdayne
    Member
    Posted 6 years ago #

    Can you give me a mySql walkthrough on the comments table, please? I don't know where to find that data.

    Thanks!

  6. whooami
    Member
    Posted 6 years ago #

    umm, what do you mean by walkthrough? If you have phpmyadmin available, you click on the table name on the left hand side of the screen, and the table structure loads in the main window, like so:

    http://www.village-idiot.org/broke/comments_table.gif

    the table indexes are shown at the bottom.

    If they arent all there, you can add them using some simple SQL, or you can use that "create an index on" button that is at the very bottom.

  7. bdayne
    Member
    Posted 6 years ago #

    I have phpmyadmin open, and have selected the table. When I scroll to the Indexes it looks as though all the indexes have been created already. There are also three error messages for more than one index key being created, which I'm sure I did while trying to fix things.

    By walkthough I meant to ask if you could give me more detailed instructions for making these changes to the database than you originally posted. I don't really know enough to sort this myself, but am great at following directions. :)

  8. whooami
    Member
    Posted 6 years ago #

    well does what you see look what is inside that image? Thats a brand new 2.6.1 install that I did yesterday, and havent added anything to.

    If you need to, you *can* delete what you have added, and re-add whats necessary back.

    Also, debugging these sorts of things, is simpler than you might think :)

    Add this:

    define('WP_DEBUG',true);

    to your wp-config.php and MySQL errors will show up on your edit comments page.

    --

    Back to the first thing though..

    you should have only ONE primary key, and you shouldn't be able to delete that one, if I remember right.

    Here is the SQL for adding all FOUR of the indexes.

    ALTER TABLE 261_comments ADD INDEX comment_post_ID ( comment_post_ID )

    ALTER TABLE 261_comments ADD INDEX comment_date_gmt ( comment_date_gmt )

    ALTER TABLE 261_comments ADD INDEX comment_post_ID ( comment_post_ID )

    ALTER TABLE 261_comments ADD INDEX comment_post_ID ( comment_post_ID )

    You should be able to delete the keys youve added, and readd them properly. Click the SQL button at the top of the page.

    --DONT DELETE THE TOP MOST PRIMARY ONE.--

    And for heaven's sake, back up first.

    ** Note that you will need to change the table name prefix, 261_ to whatever yours is, and that the forum ate my tick marks.

    all the table fields are enclosed in ticks.

    If you cant figure this out, email me off list, and ill fix it for you -- village-idiot.org is the domain, whoo is the name.

  9. bdayne
    Member
    Posted 6 years ago #

    Whoo, you are a star.

    Thanks so much for the detailed directions. They look idiot proof. ;) I'll have a go at fixing it myself, and email you if I need to.

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic