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

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,

Tim
 
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.
 
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? :)
 
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.
That's actually been reported as a bug - when a forum is deleted, the posts aren't removed from the DB.
http://xenforo.com/community/threads/deleting-a-forum-doesnt-delete-its-threads.9743/
I should have checked but I assumed the posts had also been deleted along with the forums by your Admin.

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? :)
That's what I'd do.
Code:
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.
 
Top Bottom