Fixed deleting a forum doesn't delete its threads

sforum

Active member
While this should absolutely be implemented, in the meantime a practical solution would be to clean up before import.
Any advice on how to "clean up"?

I have been running XenForo on my test server and customising it, using data imported from my live forum as a testbed. I am not at the stage where I want to dump all of the threads & users from my test site, so that I can migrate it to my live server & import the current database.

What is the easiest way to to do this? Is there a quick way to completely drop the hundreds of thousands of existing threads from my database, leaving no orphaned links or anything?

Thanks. :)
 

Jake Bunce

XenForo moderator
Staff member
Any advice on how to "clean up"?

I have been running XenForo on my test server and customising it, using data imported from my live forum as a testbed. I am not at the stage where I want to dump all of the threads & users from my test site, so that I can migrate it to my live server & import the current database.

What is the easiest way to to do this? Is there a quick way to completely drop the hundreds of thousands of existing threads from my database, leaving no orphaned links or anything?

Thanks. :)
The best approach with test imports is always to "import fresh" when it comes time to go live, as opposed to building onto your test forum. Use the test forum as a point of reference in running the final import on a new installation of XenForo, and in applying your customizations to the live forum. You should avoid running the same import multiple times on one database since there is no good way to deal with duplicate content from multiple imports.

With respect to this bug report... if you plan to prune threads at the same time that you import to XenForo then you should try to do the pruning on the old forum before the import because once you are running XenForo there is no utility to mass prune (yet). If the old forum also lacks such a utility then there is no good solution for pruning threads.
 

sforum

Active member
The best approach with test imports is always to "import fresh" when it comes time to go live, as opposed to building onto your test forum. Use the test forum as a point of reference in running the final import on a new installation of XenForo, and in applying your customizations to the live forum. You should avoid running the same import multiple times on one database since there is no good way to deal with duplicate content from multiple imports.
That is my intention, but I want to drop all of the existing threads/messages, whilst keeping the node structure, customisations, etc. I will then do a fresh import with the most recent db, as you suggest.

Is there a way to do this? If not, starting from scratch again on the live server will not only mean a lot of downtime (since you would have to install and build your forum from scratch, based on what you had discovered during the development stage), but may well result in me forgetting some little add-on or customisation here and there!

With respect to this bug report... if you plan to prune threads at the same time that you import to XenForo then you should try to do the pruning on the old forum before the import because once you are running XenForo there is no utility to mass prune (yet). If the old forum also lacks such a utility then there is no good solution for pruning threads.
Yep, that's my plan - I'm going to tidy my existing forum up to make sure it's squeaky-clean, before backing it up, then using Benjy's excellent PunBB Importer to bring it over from the dark side to XenForo. :D
So basically I just want a way to get rid of all the threads/messages on the test forum, but retain everything else, so I can move it to the live environment, import, then unleash it on the world!
 

Jake Bunce

XenForo moderator
Staff member
That is my intention, but I want to drop all of the existing threads/messages, whilst keeping the node structure, customisations, etc. I will then do a fresh import with the most recent db, as you suggest.
Possible, yes. But that is what I advise against. There is no easy way to deal with duplicate content from the first import. You should create a new installation of XenForo, do the final import on that new forum. Then use the test forum as a point of reference in reapplying your customizations to the new installation, as opposed to building onto your test forum and taking it live.
 

gordy

Well-known member
That is my intention, but I want to drop all of the existing threads/messages, whilst keeping the node structure, customisations, etc. I will then do a fresh import with the most recent db, as you suggest.

Is there a way to do this? If not, starting from scratch again on the live server will not only mean a lot of downtime (since you would have to install and build your forum from scratch, based on what you had discovered during the development stage), but may well result in me forgetting some little add-on or customisation here and there!
I have the similar plan, and I'm looking at options, since there is no checkpointing during the import, another way may:

Take one of your prod full backups from 30 days prior.
Import the 30 days and older backup on your dev site.
Develop dev site, styles, mods, etc.
Prune all data from the prod site older than your 30 day checkpoint.
Put prod site into maintenance.
Do another import with the prod pruned database (posts should only be from the the checkpoint and newer)
Push your dev to prod.

Let us know what worked for you :)
 

Rob

Well-known member
Is this still an issue? I distinctly remember deleting some nodes about ten minutes ago and was warned that threads WOULD be deleted.

Just checking
 

electrogypsy

Well-known member
I'm curious about this as well. I was about to clear out a lot of old posts in the hope of reducing my db size, but if it's not going to do anything I'm going to wait to this issue is addressed.
 

Zephyr

Well-known member
Hello, I'm french and do not quite understand the thread of the discussion.

Is it possible to delete my subjects permanently after deleted a forum please ?

Thank.
 

Jake Bunce

XenForo moderator
Staff member
Hello, I'm french and do not quite understand the thread of the discussion.

Is it possible to delete my subjects permanently after deleted a forum please ?

Thank.
Ideally you should manually delete the threads using inline moderation before you delete the forum. Otherwise there is no good way to delete the threads. But this doesn't cause a problem other than those threads consuming storage space.
 

erich37

Well-known member
Ideally you should manually delete the threads using inline moderation before you delete the forum. Otherwise there is no good way to delete the threads. But this doesn't cause a problem other than those threads consuming storage space.
hmmm.... deleting 14000 threads manually :eek:

I guess I will just delete my Forum completely..... and maybe re-install anew....
 

Zephyr

Well-known member
I have a problem of pagination with xenportal, 74 pages for 4 news... :/
Else, no problem with sitemap ?
 

mjda

Active member
Is it safe to just manually delete the posts that were left behind? If so, is there anything that needs to be done afterwards to make sure counters and all remain accurate?
 

Jake Bunce

XenForo moderator
Staff member
Is it safe to just manually delete the posts that were left behind? If so, is there anything that needs to be done afterwards to make sure counters and all remain accurate?
Manual db deletions are possible but I don't recommend it. There are many joined records to consider. I suggest leaving the threads in the database until a fix is added to the software.
 

shawn

Well-known member
Manual db deletions are possible but I don't recommend it. There are many joined records to consider. I suggest leaving the threads in the database until a fix is added to the software.
What about just writing a script that uses the datawriter to do it? Run a query to search for threads that have a node_id that isn't in the xf_node table?
 

mjda

Active member
Manual db deletions are possible but I don't recommend it. There are many joined records to consider. I suggest leaving the threads in the database until a fix is added to the software.
That's what I figured. I just wrote "fixes" in my scripts to ignore those threads until it is fixed in the software. Thanks for verifying, though.
 

Jake Bunce

XenForo moderator
Staff member
What about just writing a script that uses the datawriter to do it? Run a query to search for threads that have a node_id that isn't in the xf_node table?
That would be the correct way, yes. Such a script would need batch processing though.
 
Top