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

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

Discussion in 'Troubleshooting and Problems' started by RoldanLT, Mar 17, 2013.

  1. RoldanLT

    RoldanLT 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?
    :(
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    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.
     
    RoldanLT likes this.
  3. RoldanLT

    RoldanLT Well-Known Member

    I have a lot of forum nodes, they deleted not just one forum section.Most of forum sections.
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    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).
     
    RoldanLT likes this.
  5. RoldanLT

    RoldanLT Well-Known Member

    I can use sql query if theirs an available.
    I don't have any soft deleted threads previously.
     
  6. RoldanLT

    RoldanLT Well-Known Member

    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.
     
  7. Chris D

    Chris D XenForo Developer Staff Member

    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.
     
    RoldanLT likes this.
  8. RoldanLT

    RoldanLT Well-Known Member

    Awesome, everything works fine now.
    How about restoring soft deleted post?
     
  9. Chris D

    Chris D XenForo Developer Staff Member

    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.
     
    RoldanLT likes this.
  10. RoldanLT

    RoldanLT Well-Known Member

    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.
     
  11. RoldanLT

    RoldanLT Well-Known Member

    How to rebuild user's stats?
    -Post Count
    -Likes Recieved
     
  12. The Dark Wizard

    The Dark Wizard Well-Known Member

    Hmmm there is a query some where on the site for it that I have used in the past, I can't find it for you right now because I'm on the go but hopefully someone will.
     
    RoldanLT likes this.
  13. RoldanLT

    RoldanLT Well-Known Member

    This now fixed. Thanks !
     

Share This Page