
True Story: Drop Database? Click… Doh!
The following is a true story, dated today at approximately 11:00 AM while on my way out to lunch. This is NOT a paid post, but I have added a HUGE link to the company in appreciation of them saving my butt!
Development 101 says that when you mess with your code or your data, you always first do a backup. No exceptions. The 15 minutes it may take to do that backup could save you months or years of work.
Today, I broke Development 101.
While I was deleting a plugin, I noticed that there were some accompanying tables associated with the plugin. I quickly selected the tables and clicked DROP.
Of course, the obligatory warning arose from my browser but I, the smart one, already had my thumb over the enter button quivering with anticipation. The next moment happened in slow motion… as my thumb started the trip downward, toward the button, I began to peruse the warning across my browser.
"Are you sure you wish to drop Database mydatabasename?" Click.
I’m not exactly sure why my reading and cognitive abilities were outpaced by my thumb mashing the enter key, but the undeniable happened. I just deleted my WordPress database.
I immediately felt nauseous and a cold sweat broke on my forehead. I quickly opened my FTP application and scoured the server for any remnants of a database that may have been deleted. Unfortunately, web servers don’t have a trash bin. They’re smart enough to double-check with you before you do something stupid.
I’m stupid.
As a last resort, I logged into my hosting control panel, opened a support ticket and wrote the following:
I just deleted my database on my server. Please tell me that you have some kind of backup process in place to restore from. This is my life’s work. Sob. Hitch. Moan.
Ok, I didn’t actually type sob, hitch and moan – but you bet your ass that’s what I was doing when I wrote the ticket. Within 2 minutes, I had a response by way of email:
Dear Customer,
You may login to your Reseller Account and request a restore from the Product options. The price of a restore is $50.
Thanks!
Sure enough… I go to the products page and there, in all its glory, is the icon to request a restore from backup. The simple form asks for which date you wish to use and to also enter any applicable information. I simply write the database name and ask them to restore it from the latest backup they have.
Within 20 minutes my site was back up minus my 2 latest posts. I quickly reassembled those posts from email (where I subscribe to my own feed) and my site is back up 100%. I also missed out on 1 comment (sorry Jason!).
I’d been with this host for a long time now. Now I’m with Flywheel and automated nightly backups are part of their offering.
If I had one complaint, it’s that after the ticket is closed you have no means of communicating with them about it. I wish you could add a comment to a closed support ticket.
Today it would have said, “Thank You!”.
I’ve dropped DBs by accident that I didn’t mean to as well 🙂
Fortunately, my webhost also keeps backups 🙂
Dreamhost actually just added last month I believe the ability to recover your backups all by yourself for free, which is pretty sweet, and it even covers your files if you want.
After I dropped my first DB accidentally I started doing what I knew I was supposed to do in the first place, exporting the DB to a local copy. Incredibly, I have actually used those after doing dumb stuff as well 🙂
We get so good at we are doing we sometimes do the dumbest things. I have been there and done that and as Alex says, I still occassionally have had to use the backup.
Glad you were able to restore it.
Glad you got yourself out of that mess! Talk about blogocide when you changed your url, that would have really killed it!
I take no chances with this sort of thing, and backup regularly, not just when I’m about to make a change. I use the wp-db-backup plugin which emails me a full backup of my database every Monday, though you can choose how often you want it. I would highly recommend this for anyone because of exactly the issue you describe above, but also in case of any hacking or other problems that could render your database useless. It is nice to be able to pay for a restore courtesy of your host, but much easier and cheaper to always have your backups to hand.
Don’t do it again Doug 😉
But, oh, how I love to live on the edge. 🙂