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

Recover Deleted Threads

Discussion in 'XenForo Questions and Support' started by akia, Aug 18, 2012.

  1. akia

    akia Well-Known Member

    I've got loads of threads in my database that I'd like to try and recover.

    The threads were in a forum which was deleted, but due to the bug at the time the threads were not removed.

    Now I've had a poke around my database and they all have the node id set to 38.

    I want to put them in in a forum that is node number 118.
    I've tried to manually update one record and change the node id and it seems to work. The thread is showing in that forum.

    Is this safe to do to recover all the other threads.

    And is there a quick way to change all the node ids from 38 to 118
  2. Chris D

    Chris D XenForo Developer Staff Member

    This query run on your database should do the trick.

    UPDATE xf_thread SET node_id = 38 WHERE node_id = 118
    Of course with any mass database operation such as this you should always back up your database first.

    After running, you will need to go to Admin CP > Tools > Rebuild Caches and rebuild Thread and Forum information. Maybe Search Index too? Not sure on the last one.
    akia likes this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I think you want to swap the 38 and 118. 118 is the destination, right? Otherwise that query is correct.
  4. Chris D

    Chris D XenForo Developer Staff Member

    Hmm. I think I got the query the wrong way round.

    I really need to start getting more sleep.

    118 is the destination. So I think my query needs to be swapped.
  5. webmacho

    webmacho Member

    Ho to recover just one tread? I deleted first post as admin in one tread and with that I deleted tread, how to reverse that?
  6. Chris D

    Chris D XenForo Developer Staff Member

    Did you permanently delete it or soft delete it?
  7. webmacho

    webmacho Member

    permanently,, there was not other option, what is soft? just visibility?
  8. Chris D

    Chris D XenForo Developer Staff Member

    Usually if you have relevant permissions, you get two options:

    If you permanently deleted the first post in a thread, you permanently deleted the posts too. Only solution is to restore from a recent backup if you have one.
  9. webmacho

    webmacho Member

    thank you

Share This Page