View Full Version : Search for empty posts and delete
John Diver
11-26-2014, 03:15 PM
Hey,
I upgraded a forum from 3.8 and I have some RSS feeds setup, some of the feeds are showing blank posts - I would like to know how I can search for any blank posts first so I can check the feed and how I could delete any posts that have a blank message - Some posts have the title but no actual post for some reason.
Thanks for any help :)
HM666
11-26-2014, 06:48 PM
Hey,
I upgraded a forum from 3.8 and I have some RSS feeds setup, some of the feeds are showing blank posts - I would like to know how I can search for any blank posts first so I can check the feed and how I could delete any posts that have a blank message - Some posts have the title but no actual post for some reason.
Thanks for any help :)
Have you recounted everything after upgrading from vb 3.8 to vb 4? If not you need to login to your admincp and go to Maintenance>General Update Tools and update your threads, forums, posts, members, etc.
John Diver
11-26-2014, 07:26 PM
Thanks for the reply.
I have been running these today, its taking quite a while, 260k+ threads - But these were new posts, it was showing the title but no body content.
I was hoping to find any that are coming blank so I can work on that feed.
Thanks Len
HM666
11-27-2014, 02:42 AM
Thanks for the reply.
I have been running these today, its taking quite a while, 260k+ threads - But these were new posts, it was showing the title but no body content.
I was hoping to find any that are coming blank so I can work on that feed.
Thanks Len
Yeah when you have a large forum it will take quite some time to do these. Something seriously freaky is going on with your site since your upgrade. What steps did you take for your upgrade exactly and what version did you upgrade from?
John Diver
11-27-2014, 08:02 AM
Hey Len
I upgraded from 3.8.3 I think it was,, it was 3.8.x anyway.
I copied the database to a new db by SSH and just ran through the upgrade script
HM666
11-27-2014, 10:30 AM
Hey Len
I upgraded from 3.8.3 I think it was,, it was 3.8.x anyway.
I copied the database to a new db by SSH and just ran through the upgrade script
Why did you copy it to a new database? That is a step that you do not need to do. Was the site live at the time?
John Diver
11-27-2014, 04:13 PM
Yeah the site was live, I meant I did a copy as a test site so I wasn't working with the live db
Lynne
11-27-2014, 04:40 PM
Did you check the actual RSS feed itself to see if it was feeding you blank posts?
John Diver
11-27-2014, 05:19 PM
Hey Lynne, yeah I checked it and the feed is working fine
HM666
11-27-2014, 05:50 PM
Yeah the site was live, I meant I did a copy as a test site so I wasn't working with the live db
Ah ok. :)
Lynne
11-27-2014, 06:06 PM
Can we get a link to the feed and also what do you have set for the RSS template?
John Diver
11-27-2014, 06:44 PM
Hey Lynee, is there a query I can run to find posts with a blank body (No characters for the message)?
Thanks
vBNinja
11-27-2014, 06:58 PM
Hey Lynee, is there a query I can run to find posts with a blank body (No characters for the message)?
Thanks
SELECT postid FROM post WHERE pagetext = '';
I don't see why you would have blank posts though
John Diver
11-27-2014, 07:25 PM
Showing rows 0 - 29 (2957 total, Query took 0.0164 sec)
So thats 2957 empty posts or am I getting something wrong?
vBNinja
11-27-2014, 08:11 PM
So thats 2957 empty posts or am I getting something wrong?
Yes it means there are 2957 empty posts... No clue why you have that lol
John Diver
12-02-2014, 12:31 PM
Weird... Could anyone help with the query to remove the blank posts, I wonder if they were blank or if the content was lost..
Thanks again :)
It's a pretty simple query to DELETE FROM post WHERE pagetext = '', but I don't know if that's a good idea. When you delete a post in vbulletin it also handles deleteing anything else that needs to be deleted (like the thread if you delete the only post), and keeps counters up to date. I think it would be a better idea to use a php script to query for the post ids, then call the vbulletin delete_post() function for each one.
Lynne
12-02-2014, 03:58 PM
If you are going to run a query to do this, I would STRONGLY suggest doing it on a test site first. If you don't write a script like Kevin suggested, then make sure your run Rebuild Thread Information, Rebuild Forum Information, Rebuild Post Count, Remove Orphan Threads, and Remove Orphan Posts all from the Maintenance > General Update Tools screen. Then click on some threads/posts that you know were empty and see if everything is working correctly. And then, and ONLY then, should you do a database backup of your live site and do the same thing there.
John Diver
12-02-2014, 07:22 PM
Thanks for the replies.
Bit of a mission to get this fixed, I will try doing a fresh test upgrade again and see if the same happens.
Kevin, you posted before that the RSS poster would bypass vBulletin stopping a post if it was blank, but if it was run through the admincp an error would show that the subject of body is blank, does that mean the script is still able to bypass that and post a blank message?
Kevin, you posted before that the RSS poster would bypass vBulletin stopping a post if it was blank, but if it was run through the admincp an error would show that the subject of body is blank, does that mean the script is still able to bypass that and post a blank message?
Oh, no, if you were seeing errors about it then probably not. I based my comment on the code in the thread/post data manager. If the post is being made as "automated" then it skips some checks (like minimum characters). There are some things done to the post body after that check, like censorng and removing unprintable characters, so I imagine that it's possible that a post could turn out blank anyway, but maybe there's some other explanation in your case.
If you have a feed that's producing blank posts then it might help track down that error.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.