Trash Can

Will Franco

Active member
As an admin, how can I restore nodes or threads that have been deleted? Other applications use a "trash can" feature, which retains deleted information for 30 days.
 
XF doesn't have that functionality.

Once content is hard deleted, it's gone.

It would require restoring from a backup to recover the content, but any content posted since the backup was taken would subsequently be lost.
 
Thank you for the quick reply. Could you direct me to a forum post discussing aggressive backup and restore protocols?
 
In what respect?

There are many such discussions related to taking backups/restoring backups.
 
Goal
  • Backups every 5 minutes
  • One-click rollback
I'm not an XF developer, nor are our server admins.

I need a starting point for them to investigate the process. Most likely, the name of a database, type of cron, or context on how XF works.
 
Backups every 5 minutes does not really help if you notice the issue 10 hours later. You lose 10 hours of user activity if you roll back to a backup from 10 hours ago.
 
xenforo already does that with threads and posts. by default they are designed to be soft-deleted. you have to manually select permanent delete to get rid of them. the one big problem iirc is when you delete a node from backend. there is no failsafe there. you have to be sure that the node you are deleting has no content that you want to save.

soft deleted posts and threads stay in database permanently. they can be checked and restored at any time. i personally liked how ips used to handle it (not sure what they do now). anything deleted was sent to a trash can like you mentioned and it got deleted permanently after around 30 days or so? but i am fine with how xenforo handle things. i take a database backup before making any major change or deleting a node or category. i just wished, xenforo had a way to get rid of soft-deleted posts. there is a way to get rid of soft-deleted threads using batch update feature in backend. but for posts, you have to use an addon like the one andy has.

basically, just take a quick backup of the database before doing anything that you think is a big change to forum's structure.
 
Great idea! We've added it to our documentation. Thank you!

However, this process doesn't cover the actual risk of accidentally deleting the node instead of moving it, or mistakenly deleting threads during a batch update are possibilities.

Both actions can permanently delete data with just two clicks, and there's a high probability you wouldn't even notice the data is gone until the 404’s roll in.
 
Last edited:
You can remove hard-delete permissions from staff, in which case they will only be able to soft-delete content. You can also remove the 'Manage nodes' permission from administrators to prevent them from being able to remove a node.
 
Node: Trash (View Permissions Off)
DONE

Downgrade Super admins to Admins and remove manage node permission.
DONE

What backup schedule do you use?
This depends on the activity of your site, or the importance of data. Most sites only need a daily at most (some could even get by with a weekly), others need to do multiple backups in a day.
 
I realize my question was not well-formulated, and I essentially answered it myself.

What approach would you recommend for setting up a real-time backup system for Xenforo? Is frequent mysqldump's a good approach or is there a more efficient way?
 
Back
Top Bottom