XF 1.1 Help; Deleted Entire Forum

cbertozz

Member
Hi Guys
I stupidly deleted a live forum when trying to prune a duplicate!!

How can I recover a deleted Forum and the threads/posts within it?

Appreciate your help....anyone!

Thanks
 

Brogan

XenForo moderator
Staff member
You will need to restore from a backup.

Any content created since the backup was taken will be lost.
 

cbertozz

Member
Ok so that assumes that I have a backup service? Xenforo doesn't do anything automatically does it?
 

Brogan

XenForo moderator
Staff member
No.
You or your host must make backups - it's a good idea to do it at least once a day.
 

Chris D

XenForo developer
Staff member
Frankly, not having a backup service would be ridiculous. So I'm sure you have one (y)
 

Martok

Well-known member
Ok so that assumes that I have a backup service? Xenforo doesn't do anything automatically does it?
No, Xenforo doesn't back things up.

If you aren't making backups yourself, check with your host - some run backups of databases as part of the service.

If they don't and you haven't got any backup, then you've learned a valuable lesson today. ;)
 

Chris D

XenForo developer
Staff member
The good news is, if you've not yet upgraded to XenForo 1.2, your posts and threads may still be in the database. But it will be easier to restore from a backup if you have one.
 

cbertozz

Member
OK so apparently we have nightly backups, is there a procedure that I need to follow to get the forum back - can I do it without affecting the rest of the site?
 

cbertozz

Member
The good news is, if you've not yet upgraded to XenForo 1.2, your posts and threads may still be in the database. But it will be easier to restore from a backup if you have one.
No this is 1.1.4 - it will take ages to get at the backup - is there a procedure for getting them back out of the database?
 

cbertozz

Member
The good news is, if you've not yet upgraded to XenForo 1.2, your posts and threads may still be in the database. But it will be easier to restore from a backup if you have one.
I have requested a backup but either way could you point me in the way of restoring from both backup or database?
 

Chris D

XenForo developer
Staff member
There's something you can try, but the problem is it's probably not recommended.

As funny as it may sound, before trying this you should do a full backup so that if this goes wrong, you can just go back to how you were now. Better to have more backups than you need :)

You might also want to wait and see if other people such as @Brogan or @Mike agree it's worth a try... I think Mike yesterday said something similar was NOT recommended.

You need to know the node ID of the forum you deleted. If your forum had the "URL portion" option configured, let me know as the instructions will be different.
  • Create a new, blank forum where the one you deleted was.
  • Once created, make a note of the NEW forum's node_id.
  • Using PHP My Admin or similar, find the xf_node table and find the NEW node in the list. Change the node_id value for the NEW node so it has the node_id of the DELETED node.
  • Still in PHP My Admin, find the xf_forum table and again, find the NEW node in the list. Change the node_id value so that the new node again, has the ID of the old node.
That *should* be enough to have those posts visible again. But you will need to go into Tools > Rebuild Caches and rebuild Forum information.

Again, you can try this if you wish, but make sure you do have your hands on a working backup before you do so.
 

cbertozz

Member
There's something you can try, but the problem is it's probably not recommended.

As funny as it may sound, before trying this you should do a full backup so that if this goes wrong, you can just go back to how you were now. Better to have more backups than you need :)

You might also want to wait and see if other people such as @Brogan or @Mike agree it's worth a try... I think Mike yesterday said something similar was NOT recommended.

You need to know the node ID of the forum you deleted. If your forum had the "URL portion" option configured, let me know as the instructions will be different.
  • Create a new, blank forum where the one you deleted was.
  • Once created, make a note of the NEW forum's node_id.
  • Using PHP My Admin or similar, find the xf_node table and find the NEW node in the list. Change the node_id value for the NEW node so it has the node_id of the DELETED node.
  • Still in PHP My Admin, find the xf_forum table and again, find the NEW node in the list. Change the node_id value so that the new node again, has the ID of the old node.
That *should* be enough to have those posts visible again. But you will need to go into Tools > Rebuild Caches and rebuild Forum information.

Again, you can try this if you wish, but make sure you do have your hands on a working backup before you do so.
So should I be able to see the OLD forum in the in the xf_node table?
 

Chris D

XenForo developer
Staff member
No. You deleted it.

You need to know what the node ID of the deleted forum is.
 

cbertozz

Member
No. You deleted it.

You need to know what the node ID of the deleted forum is.
So I need to remember it? There's no other trace remaining in the database I could search? If its not there at all - how can I restore it?

I know you are going out of the way to help and I appreciate it.
 

cbertozz

Member
OK so admin log shows:

array(2) {
["node_id"] => string(1) "7"
["_xfConfirm"] => string(1) "1"
}

So I assume the id is 7
 

cbertozz

Member
That's right.

It's also in the URL of the forum... so no doubt you'll be able to find it in your browser history, for example.

e.g. http://xenforo.com/community/forums/xenforo-questions-and-support.25/ This forum is node ID 25 because it ends in .25.
Hi Chris

Almost there - looks like the right stuff is in the database but can't get the forum to appear on the site. I've done all the rebuild stuff in the Tools page but its still not appearing. Any ideas ? I'm new to Xenforo
 

Brogan

XenForo moderator
Staff member
Have you tried rebuilding the other caches, or try editing the node and saving again, from within the ACP node tree.
 
Top