Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: jsx on April 07, 2019, 09:08:47 AM

Title: Recover deleted posts
Post by: jsx on April 07, 2019, 09:08:47 AM
Hi,

Is there any way to restore deleted posts from the old copy of the database and add them to the current database?

I found such instruction for SMF 1.1

http://www.prettyscripts.com/code/sql/smf-recover-deleted-topic/
Title: Re: Recover deleted posts
Post by: Arantor on April 07, 2019, 09:12:30 AM
The same instructions should work although they won't fix missing attachments.
Title: Re: Recover deleted posts
Post by: EthanR on November 14, 2019, 06:47:33 PM
Apologies about digging this post up.

I accidentally deleted a topic and restored it from a backup using the method in the link (re-inserting the relevant SQL into the live DB). That worked fine but as Arantor mentioned the post attachments are missing.

Is it possible to restore the attachments to each message? If it's possible I can even do it manually in the SQL since it's not a very big topic. I had a look at the SQL and I'm not sure how attachments are linked to posts so some guidance would be much appreciated.

I have a backup of the attachment directory before the thread was deleted as well. On SMF 2.0.15
Title: Re: Recover deleted posts
Post by: EthanR on November 20, 2019, 12:08:37 AM
I couldn't figure out a way to reconstruct the db entries for the attachments so I just added them inline. Have a recycle bin for deleted threads now. Don't delete threads is the lesson learnt.