Today I deleted all of my forum's users...OOPS!

Ashley z

Reputable
Joined
Jul 16, 2015
Messages
212
Reaction score
0
FP$
2,881
I'm in the first few days of Talkgg's life. I've racked up over 100 posts on the forum with a handful of members. Today I screwed up big time though. I am working on an algorithm that uses multiple factors to quantify the quality of a user. I don't want to give it all away, but it uses a lot of ratios, division and multiplication to come up with a number that represents user quality. It does this by taking multiple entries in each user's database row, using the algorithm and outputting the entry to the table.

Here's where I messed up. My algorithm worked, but I wanted to add a couple factors in. I had done all of this in PHPMyAdmin using a View in the DB. I deleted the View because I thought to myself "I can just make a new View later when I fine tune the last factors I want included in the algorithm." Well..Deleting a View in PHPMyAdmin also deletes corresponding tables. I lost the entire User table.

All of a sudden there was no Admin account, and no actual user accounts on the forum. Posts have names attached, but when you click on a Member it gives the error that the member did not exist. Ut oh!

It was much worst than it sounds because I had to leave for work in 5 minutes, so I knew my forum would be shutdown for 7+ hours before I'd even get a chance to fix it.

How I fixed it - I had no database backup yet because it's the first few days and I didn't think I'd make a common sense mistake like I did...I must have just blanked on the fact that the whole User table would be deleted.
  • Install MyBB again
  • Merge Old DB (old DB had everything except user info) with New DB
  • Create new user accounts manually for all of the members
  • Go into the Posts/Threads tables and edit all the UID on the posts/threads to match the newly made user account's IDs.
  • In hindsight I could have just altered the new UIDs to match the old UIDs on posts/threads instead of altering each individual post/thread ID to new UIDs...Would have saved about 30 minutes, but oh well.
  • Redid all the template changes, including post icons, forum icons, and index changes.

I still have a lot to fix though... I have to do 1 more Header change, 1 more Footer change, set up all the Warning System reasons again, reconfigure a few more plugins and do some other stuff on the backend.

So...big issue, only took around 3 hours to fix it all though. It was a pain in the ass because PHPMyAdmin was getting cached so I couldn't access the new DB for a bit. I think it took so long because I wanted to make sure I got everything right. I could have done it smarter and shaved off 30-45 minutes, but oh well.
 
Ouch! See I hate PHPMyAdmin, it's annoying and you mess with one tiny thing your whole forum gets screwed up. 😛

I'm glad you got it working again, hopefully the members understand.
 
Thomasss said:
Ouch! See I hate PHPMyAdmin, it's annoying and you mess with one tiny thing your whole forum gets screwed up. 😛
I'm glad you got it working again, hopefully the members understand.

All but 2 of my members are from FP. One of the others I know in real life so I texted them. The other one I reached out to on Skype. I PMed the FP members on here with their login details (same Username as before, I made new passwords for them - nobody shared a new PW, so no security risk here). I'm hoping they understand! I had maybe 3 members that posted regularly without engaging in an exchange of some sort, so I'd be really sad to lose those members. I know they enjoyed the site enough to come there for fun and I hope they don't think lesser of me because of this mistake.

I feel like my error is a large hit on my site's reputation.
 
I'm so sorry to hear that, Ashley! It must of sucked. I know I personally would probably have had a heart attack haha. I hope you get your member base back up!
 
Teapot said:
I'm so sorry to hear that, Ashley! It must of sucked. I know I personally would probably have had a heart attack haha. I hope you get your member base back up!

Me too! The forum is still new, so I'm glad it happened now instead of with hundreds of members. I'm having issues getting new members to sign up without doing an exchange, but that will improve over time.
 
Been there, done that. The best practice is just backing up before you do ANYTHING. Luckily this was only a few days, posts and users in.
 
Oh no! I'm sorry that happened to you!

Like others have said though, at least the forum was still new so you didn't lose alot of stuff.

Accidents happen though. 😛
 
Jerlene said:
Been there, done that. The best practice is just backing up before you do ANYTHING. Luckily this was only a few days, posts and users in.
Yeah had about 105 posts and 8 members. I only lost the users though so all content was kept in place. All the users had to do was use the new password I provided, log in, change pw and email and upload a new avatar if they wanted.


Allenafaith said:
Oh no! I'm sorry that happened to you!
Like others have said though, at least the forum was still new so you didn't lose alot of stuff.
Accidents happen though. 😛
I know right? It was a really silly mistake, but I learned my lesson. I just wish I had backed up before messing around with it. In hindsight I'm going to backup the DB even if I am doing stuff that I don't think I will mess up.
 
Ashley z said:
I know right? It was a really silly mistake, but I learned my lesson. I just wish I had backed up before messing around with it. In hindsight I'm going to backup the DB even if I am doing stuff that I don't think I will mess up.

Good idea. I hope it doesn't happen again. :yes:
 
Thomasss said:
Ouch! See I hate PHPMyAdmin, it's annoying and you mess with one tiny thing your whole forum gets screwed up. 😛

I'm glad you got it working again, hopefully the members understand.

This is why I never liked hosting with FTP/Cpanel access period. One little screw up and you could be in big trouble. Thank God for free hosting solutions that don't offer FTP access!
 
Ashley said:
This is why I never liked hosting with FTP/Cpanel access period. One little screw up and you could be in big trouble. Thank God for free hosting solutions that don't offer FTP access!

I feel like I am talking to myself when I'm quoting you.

Anyways, I think having access to cPanel, phpMyAdmin, etc allows for users to make mistakes and mess their site. However, it also allows them to be more creative and expand their website into much more. Free hosts or free forum providers/hosts don't allow for as much expansion or customization past the features they offer. They limit the ability to be extremely creative.
 
Sorry to hear about the trouble you had. It is always good to have a backup! I learned that myself the hard way a few years ago. Even the smallest changes can mess things up if they're not done correctly.
 
Back
Top Bottom