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

XF 1.1 What happens to the threads inside a forum once it's deleted

Discussion in 'XenForo Questions and Support' started by faeronsayn, Mar 21, 2013.

  1. faeronsayn

    faeronsayn Well-Known Member

    So I've recently deleted a lot of forums, and I am wondering what happened to the threads that were within these forums.

    How would I go about removing the completely? I created a new forum and some how some random threads appeared from a previous forum that I deleted. Probably because they had matching IDs.

    Anyway, how would I go about completely removing those threads that have their forums deleted?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    That is a bug which has been fixed in 1.1.4.

    You will need to delete those threads using queries.

    On my phone so can't provide the queries now.
    faeronsayn likes this.
  3. faeronsayn

    faeronsayn Well-Known Member

    Thanks for the reply. I am wondering, if i'd need to do extra work when I upgrade to v1.1.4 since the forums were deleted in v1.1.3.

    If you could provide some sort of queries, whenever you have time. That would be great :)
  4. Brogan

    Brogan XenForo Moderator Staff Member

    erich37 likes this.
  5. faeronsayn

    faeronsayn Well-Known Member

    Problem is v1.2 is likely to be pretty far away from release right now. I need to query all the thread IDs that exist. But I can't do that since the forums I deleted (thinking their threads would be deleted as well) still have their threads in the database.

    Since these threads are essentially in "no node" would the node_id column in the xf_thread table be blank? If I delete entries in that table would that delete the threads and all the posts in that thread?

    So maybe something like this as the query?

    DELETE FROM xf_thread WHERE node_id = '';
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Doing that won't update all the associated data.

    You would be better off moving them back into a valid forum using SQL and then deleting them using the inline mod tools.
  7. faeronsayn

    faeronsayn Well-Known Member

    I don't think that would be efficient. There would be about 30-40thousand threads i'd be manually deleting.
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Doing as you have suggested will cause all sorts of problems due to joined records.

    If you still want to do it you will need to formulate all of the relevant queries involved when a thread is deleted.
  9. faeronsayn

    faeronsayn Well-Known Member

    Where would I be able to find all the queries that are used when a thread is deleted?
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member



    I recommend against trying to do this manually.
  11. James

    James Well-Known Member

    The node_id will still exist in the db, so if you make a new node with the node ID of the one you just deleted; threads will reappear.
  12. Brandon Sheley

    Brandon Sheley Well-Known Member

    oh man, I thought this was fixed in 1.1.4 :(

    So I have a question, I just deleted about 50,000 threads and post and I was getting ready to import another database into it. Will that mess up the import since these threads are still in the database?

    I don't really care of the thread id's at this point.

    fattony69 likes this.
  13. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Always avoid running the same import multiple times on the same database. But if you insist on doing bad then see this post for queries:

  14. Brandon Sheley

    Brandon Sheley Well-Known Member

    Thanks Jake, it's actually not the same import.

    Here is the short story.
    I made a clone of my site and set it up on another url (I have 2 licenses)
    Then I removed all threads from the clone site that I didn't want on the new URL, I'm basically splitting my site up, I'll remove the opposite threads on the old URL.
    Then I have a vb database that I'm going to import on the new URL, which hasn't been imported anywhere else.
    I just want to know if I'll run into problem with the import on the new URL, also will I run into issues on the old url when those threads and forums are removed from it.

    It sounds confusing as I write this, but I know what I want to do and I think it shouldn't be a problem.
    I would just like to have all deleted threads/forums removed from the database on both installs to help trim up the database.

Share This Page