Nightmare on Server Street
There comes a moment in every budding web developer’s life, I think, when you’re left staring incomprehensibly at the screen, cradling the slow realization that everything you’d worked on was totally and utterly wiped, and that you were pretty much French toasted for file backups.
Like many half tech-savy, gen Y kids who grew up on the internet, I am just smart enough to navigate my way around the first few cushy levels of website maintenance and deployment, but pretty much an idiot when it comes to fixing server issues and troubleshooting system problems. Yesterday, while vigorously trying to investigate Mambo for a new website setup, I got frustrated with the javascript errors on my new CMS toy and decided to just delete the whole thing and start over. Oh ho, not so fast, jefe!
I did all the right things: went to my CPanel admin page and asking Fantastico De Luxe limited (server admin for idiots) to uninstall the Mambo installation and deleted the MySQL database. But when I went back to my FTP connection, I found the old directory file still there. Why? How? Annoying! Delete! And yet, like a particularly annoying AI, the folder just kept respawning.
Aagh! Click click click DELETE oh crap what folder was that? Belatedly, I realized that in frustration I had hit the permanent “delete” button on my blog folder.
But look, the entries are still here! Yeah. I have now TOTALLY learned an invaluable lesson in making backups. Lucky me, the database file itself wasn’t deleted when I got mouse-click crazy, so I still had all my post information there… somewhere. I just had no programming clue for how to restore it, and no WordPress installation to deploy.
Copying the WordPress files back into the right directory weren’t too difficult, but the “Error establishing a database connection” message drove me mad. I tweaked and tweaked and tweaked the wp.config file for the right answer. I copied another WordPress blog config file I knew worked and tried to add in what I thought was the right information. No effect! What did I do wrong?
As it turns out, it was the database file password that was missing. There is no handy message telling you how to get to this in any of the WordPress troubleshooting docs I read, and my web hosting service’s CPanel documentation was inconveniently spare on description. What I eventually figured out was how to open up a MySQL database for which I did know the password in a text file, searched for its position, and using the text preceding it, went back to my original WordPress database and hunted for the password to that. Once I had the right components, then ta-da! Everything suddenly worked again.
Until I started messing around with the domain name redirections…