Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: showngo - helmikuu 28, 2019, 06:46:53 IP

Otsikko: Removing attachments for delete posts question
Kirjoitti: showngo - helmikuu 28, 2019, 06:46:53 IP
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 
Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: Arantor - maaliskuu 01, 2019, 02:34:18 AP
If you delete all the posts so that they aren't moved to the recycle bin, everything is deleted.
Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: showngo - maaliskuu 01, 2019, 04:49:02 AP
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.
Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: Arantor - maaliskuu 01, 2019, 07:33:47 AP
The attachment folder also includes user uploaded avatars.
Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: showngo - maaliskuu 01, 2019, 01:56:45 IP
I'm not deleting the attachment folder from the server, just the board on the forum. 
Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: Arantor - maaliskuu 01, 2019, 05:27:56 IP
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.
Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: showngo - maaliskuu 01, 2019, 05:34:39 IP
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.
Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: showngo - elokuu 01, 2019, 07:24:02 AP
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.

Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: Arantor - elokuu 01, 2019, 07:27:35 AP
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.
Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: showngo - elokuu 01, 2019, 07:59:51 AP
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
Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: Arantor - elokuu 01, 2019, 09:47:58 AP
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.
Otsikko: Re: Removing attachments for delete posts question
Kirjoitti: showngo - elokuu 02, 2019, 09:09:41 IP
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.