XF 1.1 Someone has soft deleted most of the threads, how to retian it? :(

rdn

Well-known member
Some of my mods, abuse their permissions.
A lot of threads where deleted, but just soft deleted.
How to un-delete all soft deleted threads?
:(
 
Select the deleted thread or threads by clicking the checkbox next to each one in the thread list.

In the inline moderation drop down there is an undelete option.
 
  • Like
Reactions: rdn
Before they deleted the threads, did you have many soft deleted threads already?

If not, I can suggest a database query that will undelete them automatically - but there will be no way to distinguish between threads that are supposed to be deleted vs the threads they deleted maliciously.

So we either do that and risk undeleting some stuff that was supposed to be deleted or you are just going to have to use the inline moderation tools (there is a Select All button).
 
  • Like
Reactions: rdn
I have learned, to disable hard delete permission for moderator.
Yes, it help for me a little bit.
But for now, I want to un-delete all of the threads that where soft deleted.
 
Code:
UPDATE xf_thread
SET discussion_state = 'visible'
WHERE discussion_state = 'deleted'
AND node_id IN (2,3,4)

That query should do it......

Notice this will only run on threads in forums "2,3,4" - you can change that accordingly to the forums you want to run it on, or just delete that entire last line to make it run on all forums.
 
  • Like
Reactions: rdn
Code:
UPDATE xf_thread
SET discussion_state = 'visible'
WHERE discussion_state = 'deleted'
AND node_id IN (2,3,4)

That query should do it......

Notice this will only run on threads in forums "2,3,4" - you can change that accordingly to the forums you want to run it on, or just delete that entire last line to make it run on all forums.
Awesome, everything works fine now.
How about restoring soft deleted post?
 
Same thing, really. Remove the last line and change "xf_thread" to "xf_post" and change "discussion_state" to "message_state".

There's one last step that bobster kindly reminded me of.

Once you've finished undeleting stuff, you will probably want to rebuild your various caches... Admin CP > Tools > Rebuild Caches.

Rebuild thread information (with post counters), poll information, forum information and then finally rebuild the search index.

The rebuilding of the search index may take a long time... but without doing that, you might find that threads are missing when you search.
 
  • Like
Reactions: rdn
After doing this, threads/post got recovered and open.

But then, User Post Count, Likes do not update.
How can I fix this?
I already did rebuild caches.

Thread Information, Forum Information, User Caches, Daily Statistics and Search Index, still user's stats not updating.
 
Code:
UPDATE xf_thread
SET discussion_state = 'visible'
WHERE discussion_state = 'deleted'
AND node_id IN (2,3,4)

That query should do it......

Notice this will only run on threads in forums "2,3,4" - you can change that accordingly to the forums you want to run it on, or just delete that entire last line to make it run on all forums.
Is it possible to specify the query to a certain user who deleted and time frame that they did so?
 
Top Bottom