Accidently deleted a topic

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
User avatar
lavalamp213
Registered User
Posts: 351
Joined: Fri Apr 20, 2018 12:48 pm

Accidently deleted a topic

Post by lavalamp213 »

I just really goofed and deleted a topic, and yes I checked the box to delete permanently.

Is there any way I can undo this and get the topic back?
:(
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Accidently deleted a topic

Post by Lumpy Burgertushie »

if you have a recent backup with that topic it is possible to restore just that topic.
however, it is not easy and really needs a database expert to do so.
all of the tables in the database are connected so it would not just be the posts table. it would have to be the posts, forums, tables etc.
it is related to the user, the group the user is in, etc. etc.

If you have a recent database backup with no or very few posts since the backup you could just restore the whole database but you might lose other things.

so, in my opinion it is just not worth the effort.

if the posts in the topic are really important you could probably make a backup of the posts table, save it to your computer, open it in a text editor and find and copy the posts from that topic into a text file.
then copy and paste them back into a new topic just so they would be available to read.


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
User avatar
lavalamp213
Registered User
Posts: 351
Joined: Fri Apr 20, 2018 12:48 pm

Re: Accidently deleted a topic

Post by lavalamp213 »

Thank you Robert.
You are correct that by doing a full restore from the backup I would lose even more than I have already.

It was just one thread I lost but a rather good one. It was so dumb how I did it. At least I know I won't make that mistake again.

Thank you.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72343
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Accidently deleted a topic

Post by KevC »

A tip that might save you in the future.
I never delete anything. I have a hidden 'trash/storage' forum and I get my mods (and me) to move things to rather than delete them and then you have a safe place to make a more considered decision on what to do with it.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
User avatar
lavalamp213
Registered User
Posts: 351
Joined: Fri Apr 20, 2018 12:48 pm

Re: Accidently deleted a topic

Post by lavalamp213 »

That's a very good idea. Thanks.
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 6673
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: Accidently deleted a topic

Post by HiFiKabin »

User avatar
lavalamp213
Registered User
Posts: 351
Joined: Fri Apr 20, 2018 12:48 pm

Re: Accidently deleted a topic

Post by lavalamp213 »

That's an interesting extension. Thanks.
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Accidently deleted a topic

Post by warmweer »

lavalamp213 wrote: Fri Sep 28, 2018 3:26 pm I just really goofed and deleted a topic, and yes I checked the box to delete permanently.

Is there any way I can undo this and get the topic back?
:(
Undoing it with the phpBB core features is impossible due to the "delete permanently" which is there just to prevent that.
However, you mention "a" topic as in "1" topic.

If you have a backup with that complete topic, it shouldn't be all that difficult to import the necessary records into the relevant tables.
However!!!, and this is a disclaimer : only try this if you know how to select and extract records using phpMyAdmin (or whichever one you use) and know how to import that data into the correct tables. (and can work with backups)
And ALWAYS test this on a parallel installation (localhost) so that you can test the result before applying it online.

The idea is that you have only deleted a topic (= 1 record in the topic-table) and some posts (in the posts_table), so all you have to do is to find the topic record and the post records and reimport them into your forum. After that is done, a simple recalculation of forum stats should set everything back to the correct state.

The sooner this is done, the easier, e.g. a user who made one of those deleted posts (or topic) may have been deleted implying that the posts and topic would remain without a legitimate author (user).

If the number of deleted posts is small (say a max of 10), then I would suggest, just copying those posts by typing them yourself in a new topic in a temporarily hidden forum, edit the post authors (built in phpBB functionality) and edit the post_time (either in phpMyadmin or by using the changetime extension (by javiexin). In this way you don't really risk anything.

Again (and I stress this very strongly) : try this on a copy of your live forum before doing this on your live forum !!!

Next time: always delete in 2 steps: first step = soft delete - second step = after reviewing only: permadelete
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
lavalamp213
Registered User
Posts: 351
Joined: Fri Apr 20, 2018 12:48 pm

Re: Accidently deleted a topic

Post by lavalamp213 »

warmweer wrote: Sun Sep 30, 2018 8:59 pm Next time: always delete in 2 steps: first step = soft delete - second step = after reviewing only: permadelete
Thanks for that. And this is the lesson learned.
I don't think I have the skills for this kind of a repair and the risk and trouble is far greater than the one thread was worth. I appreciate everyone's help here. The big take-away for me is the 2-step delete process which will save me from having this problem again.
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Accidently deleted a topic

Post by canonknipser »

Or disable the hard-delete permission completely. This will prevent not only you, but also your team from making similar mistakes again.
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
lavalamp213
Registered User
Posts: 351
Joined: Fri Apr 20, 2018 12:48 pm

Re: Accidently deleted a topic

Post by lavalamp213 »

That would prevent the problem. But it seems like eventually a board might get cluttered up though with soft deleted topics since they remain visible to mods and admins.
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Accidently deleted a topic

Post by canonknipser »

Move them to a "trash bin" forum after soft-delete, so they don't disturb any longer in your active forums. Or, if your board is quite active, those topic will go automatically to page 99+ after a short while.
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Accidently deleted a topic

Post by warmweer »

canonknipser wrote: Mon Oct 01, 2018 5:31 pm Or disable the hard-delete permission completely. This will prevent not only you, but also your team from making similar mistakes again.
Or: only give perma-delete permissions to yourself (as Administrator).
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Accidently deleted a topic

Post by canonknipser »

warmweer wrote: Mon Oct 01, 2018 7:05 pm only give perma-delete permissions to yourself (as Administrator).
The OP already has that permission and made the mistake which resulted in this topic ;)
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Accidently deleted a topic

Post by warmweer »

canonknipser wrote: Mon Oct 01, 2018 7:40 pm
warmweer wrote: Mon Oct 01, 2018 7:05 pm only give perma-delete permissions to yourself (as Administrator).
The OP already has that permission and made the mistake which resulted in this topic ;)
True, but that was before the 2-step deletion scenario.
Alternatively the TS could make a second full-admin account which does have the perma-delete permissions so that the "trash" can eventually be removed. This does imply switching accounts now and then - a step too far for me.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
Post Reply

Return to “[3.2.x] Support Forum”