Skip to:
Content
Pages
Categories
Search
Top
Bottom

Damn, it has happened again!! Lost all posts


  • shauny007
    Participant

    @shauny007

    This is the 2nd time I have lost all posts. Don’t think I can rely on this forum software any more. As normal all topics remain, and even the displayed number of posts remain correct, just inside all the posts have vanished, and from the admin area.

    This is definitely a bug, few people have posted about it happening.

Viewing 6 replies - 1 through 6 (of 6 total)

  • shauny007
    Participant

    @shauny007

    Actually that was naive of me, and I now have figured out the problem, but not the fix. Here is what actually happens:

    I upload items to website also, but sometimes in future the same exact item may be in the update, I would then end up with domain-name/item domain-name/item2 domain-name/item3 These are duplicates, I simply delete all these by running this code:

    DELETE bad_rows.*
    from wp_posts as bad_rows
    inner join (
    select post_title, MIN(id) as min_id
    from wp_posts
    group by post_title
    having count(*) > 1
    ) as good_rows on good_rows.post_title = bad_rows.post_title
    and good_rows.min_id <> bad_rows.id;

    This is what is deleting all the forum posts 100%, checked and tested it. The only thing is, I do need to run this. Is there a way to exclude in this code bbpress posts, or something?


    Gautam Gupta
    Participant

    @gautamgupta

    I’d not suggest running anything like this but if it works well in your specific case, this should work:

    DELETE bad_rows.*
    from wp_posts as bad_rows
    inner join (
    select post_title, MIN(id) as min_id
    from wp_posts
    group by post_title
    having count(*) > 1
    ) as good_rows on good_rows.post_title = bad_rows.post_title
    and good_rows.min_id <> bad_rows.id and bad_rows.post_type NOT IN ('forum', 'topic', 'reply');

    shauny007
    Participant

    @shauny007

    Hi Gautam, am going to give that a try, will let you know how I get on with it, thanks very much, appreciate 😉


    shauny007
    Participant

    @shauny007

    I also just wanted to ask, is there a way I can update the current replies in forum to replicate what is really there. For example say I had deleted 13 replies in my previous error, forum still showing 13, is there a way to reset these numbers so all correct. As only other way I can think of is by starting everything again from scratch in forum.


    shauny007
    Participant

    @shauny007

    Gautam worked like a dream, I can now operate bbpress exactly as I need, thank you 😉


    Gautam Gupta
    Participant

    @gautamgupta

    Go to Tools -> Forum and recount. 🙂

    Glad it worked.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar