Removing attachments for delete posts question

Started by showngo, February 28, 2019, 06:46:53 PM

Previous topic - Next topic

showngo

I have searched and did some reading and most of the posts are about recovering missing attachments.

My question is if i have board "A" and it is all posts with photos, if I delete all the posts, will they attached photos be removed from the servers attachment folder also or are they still there and just not linked to a post?

Thanks 

Arantor

If you delete all the posts so that they aren't moved to the recycle bin, everything is deleted.

showngo

Thanks.      I've deleted about 20 pages so far, not to the bin, it just didn't seem like the attachment count changed in the folder .   There is a bunch though. 
I'll do the #1 thing, back it up, delete, them and see.

Arantor

The attachment folder also includes user uploaded avatars.

showngo

I'm not deleting the attachment folder from the server, just the board on the forum. 

Arantor

No one was suggesting you were. In fact no one was suggesting anything about what problem you actually have beyond the thinking that deleting a post somehow didn't delete files from the attachment folder.

Just there's more in the attachment folder than just attachments.

showngo

Not upset or saying I was, just adding more information for others that come across this thread.  Wouldn't want someone mistaking what I asked and delete the wrong thing.

It's all good.

showngo

Now to expand this even more.   If I delete a board using Myphp directly from the sql database.  Will that also remove any attached images from the attachment folder. 
It is my understanding that it only removed "posts" text as the forum software (SMF) is what has the association with the tagged image file.


Arantor

No, it won't but it will leave other traces in your database that you're not cleaning up.

You should never touch the database directly unless you really know what you're doing.

showngo

Ill need to dig more into the PHP error log. 

Trying to delete an old board from SMF I get an attachment php error that will not let me do the whole board but I can do it one by one. (Thats a lot of deleting ) m

Arantor

And if you delete the board directly in the database, it will orphan every topic, post and attachment which I guarantee will cause more issues.

Instead dig out the real error and well help you fix it properly.

showngo

After looking more into this, is was a buffer error for batching too many pages together. 
I was attempting to delete / remove a board that had 180 pages to and a whole bunch of attachments that dated back to 2005.  Long story short, I kept splitting the topic to 20 pages and then removing it. It worked great, I gained over 10gig of disk space, dropped almost 8k posts and shrunk my DB from 175mb to 160mb.  All is good in my forum land.

Advertisement: