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

XF 1.4 Restoring a single thread from a backup

#1
I accidentally hard deleted a thread in my forum earlier today. I have a backup of the database from a few hours before. It is possible to restore the thread and its posts?

If so, is it as simple as restoring the inserts into xf_thread and xf_post, or are there more tables involved?

Thanks in advance!
 

Mike

XenForo developer
Staff member
#2
There really isn't a way to do this. There are potentially a large number of tables involved, including some denormalized data in places like the user table.
 

Mr Lucky

Well-known member
#3
Well there is a rather clunky way to do it with Addons but I would not want to try it with a long thread

You need to repost everything manually using the Addons login as user and change date
 
#4
Thanks for the clarification it's a nightmare. I manually copied and pasted from a server running the backup copy of the DB, into the live site. It broke attribution for the posts (nearly 400 of them) but at least the post contents are back.
 

Mr Lucky

Well-known member
#5
Would it not work to run the backup database on a copy/test installation then create a new forum and move that thread to it, delete all threads and forums except that thread and forum, delete all users not in that thread and then do an import?

(With forum closed and backed up of course)
 
Last edited:

vij

Active member
#7
I was able to restore a thread recently with a crude method.

Do this in your older database. Go to phpMyAdmin
1. Select the table xf_thread (xf is my prefix)
2. Find the thread_id of the thread you deleted.
3. Delete all threads except the thread you want. Run this: DELETE * FROM xf_thread where thread_id !=your thread number
4. Do the same for xf_posts. DELETE * FROM xf_post where thread_id !=your thread number
5. Delete all tables except xf_thread and xf_post
6. Now export the database and import into your current database