Previous Thread
Next Thread
Print Thread
Hop To
Joined: Dec 2005
Posts: 122
member
member
Joined: Dec 2005
Posts: 122
is there any i can restore a deleted forum from a sql backup?

one of my moderators deleted the contents (all the topics) of a forum, whilst in an inebriated state ...

i do data backups every day, but i don't want to overwrite the posts made since the last backup.

is there any relatively safe way this can be done??


JakChat.com -- Forums for Indonesia's English-speaking community
Ubuntu-Indonesia.com -- Forums for Indonesia's Ubuntu Users
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
it can be totally safely done, but it's uber sql time..

main problem is the autoincrement issue with POST_ID and TOPIC_ID, but that can be done too..

Joined: Dec 2005
Posts: 122
member
member
Joined: Dec 2005
Posts: 122
well my site isn't that large, < 100,000 messages. the deleted forum contained about 5000 posts, so i am guessing it won't take too long. is it a matter of getting the last POST_ID and TOPIC_ID autoincrement values, then appending from the backup POST table to the current POST table, checking each message to see what forum (FORUM_ID in TOPICS table) it was posted to? (as if that wasn't complex enough!) smile

Last edited by Okusi Associates; 03/14/2009 10:11 PM. Reason: FORUM_ID

JakChat.com -- Forums for Indonesia's English-speaking community
Ubuntu-Indonesia.com -- Forums for Indonesia's Ubuntu Users
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
yah, you perty much have it figured..

only thing i would do is temporarily remove the autoincrements, so it could be a straight transfer over with no math or gyrations involved in ID mapping ..

then edit (ALTER) the indices back after done.. wink

Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
I'd restore to a new location, purge everything that doesn't pertain to what you want to restore, sql dump everything to be restored, then restore it to the current db...


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Dec 2005
Posts: 122
member
member
Joined: Dec 2005
Posts: 122
gizmo, that's exactly what i did, in fact! i took a copy of the backup database, killed all the extraneous records, then inserted that into the current database. actually, both ubbt_POSTS and ubbt_TOPICS had to be repaired, not just ubbt_POSTS alone.


JakChat.com -- Forums for Indonesia's English-speaking community
Ubuntu-Indonesia.com -- Forums for Indonesia's Ubuntu Users
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Well, I coulda told you that tongue... It'd be because the topics table hold information on topics; and the posts table holds the post data tongue


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (1 invisible), 831 guests, and 191 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240501)