1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

DB Tables that store necessary information for threads/posts/forums.

Discussion in 'XenForo Questions and Support' started by TimWF, Feb 15, 2011.

  1. TimWF

    TimWF Active Member

    A few of our forums were accidentally deleted by an admin and we don't have a backup recent enough that we would want to roll back, so I'm tasked with trying to recreate the forums that were accidentally deleted from our nightly backup database. :)

    I'm figuring that I have to find a table for the forum listing, the table for the thread listings and a table for the post listings and get an export of the right records from those to get those forums back in place (with posts). Are there other tables I should be thinking about to do this that I'm overlooking now? Thanks,

  2. Brogan

    Brogan XenForo Moderator Staff Member

    Manually inserting data into tables is a complex process due to all the inter-relationships and inter-dependencies and really not recommended.

    Deleting those forums/posts will have adjusted user post counts, likes, etc. so all of that associated data would have to be manually changed.

    The node table also utilises the nested set function so that is more data which would have to be updated.
    TimWF likes this.
  3. TimWF

    TimWF Active Member

    Thanks for the thoughts on that Brogan. :) In doing some more investigation I have noticed that none of the thread/post data is missing actually. Just the forum records are gone. Strange to say the least there.

    It doesn't sound like that is what you would have expected though? Or that is what you would have expected?

    One thing I'm looking into now that I know that data is there is building new forums with the same names and then just changing the node_id associations for the orphaned threads to the new forums. Any thoughts on that anyone? :)
  4. Brogan

    Brogan XenForo Moderator Staff Member

    That's actually been reported as a bug - when a forum is deleted, the posts aren't removed from the DB.
    I should have checked but I assumed the posts had also been deleted along with the forums by your Admin.

    That's what I'd do.
    UPDATE xf_thread SET node_id = 10 WHERE node_id = 5;
    Where 10 is the new node id and 5 is the old node id.

    I have done this myself to move posts from one node to another, but not when those posts were orphaned due to a forum being deleted, so I can't confirm it will work exactly as expected.
    TimWF likes this.
  5. TimWF

    TimWF Active Member

    Thanks again for the guidance Brogan. :) That is the first time I have seen a bug make life so much easier! Haha!

Share This Page