September 20, 2007 | In: Internet, murphyslaw, wordpress
And we’re back! How I broke my blog and brought it back from the dead
Yesterday, a series of unfortunate events that was triggered by a combination of of trying to relocate my Wordpress directory, modifying the permalink structure and configuring a domain has led to the instant evaporation of over three years’ worth of posts. I have a partial SQL backup and another of my WP files that I am not able to restore for some reason. Combing the wordpress.org documentation and support forums is yet to yield a solution.Life goes on.
Basically, when things went bonkers, I thought I could just restore the SQL database from a backup I had made earlier and re-upload the WP files and everything was going to be as good as new. But I had another think coming. Somewhere in the vast, dark expanses of the Internet, a little evil web gremlin decided it was going to ruin my day. Before I tell you the rest of the story, let me establish a small but important fact: While I am pretty comfortable installing, tinkering with and tweaking things like Wordpress, I am no programmer. I know what PHP and SQL are, I understand how they work and how to install software that uses them for back end, but show me a small bit of code and chances are that I have no idea what this does or breaks.
That said, I dug up the Wordpress database backup that I have made about a couples days earlier (thank goodness!), and tried to use the import functionality in phpmyadmin to restore the db from the SQL backup file when I started getting these errors that the SQL file was corrupt or some other thing that, in effect, says “you’re screwed”.
I combed the Wordpress Codex and support forums for potential solutions and found many that didn’t work for me. I tried multiple re-installations and a slew of other suggested workarounds that yielded nothing. At the apex of my desperation, I opened up the sql backup file in Notepad++ and started looking at what’s in there.
The file was 17,000+ lines, at least 90% of which was comment spam that was held in moderation!. Then it sort of dawned on me that I could try to “manually” rebuild the database using the db query box in phpmyadmin (remember, I have limited but adequate knowledge of all this so don’t laugh at me).
What ensued was an hour or so of squinting, rummaging through the SQL file, and frantic cut-and-paste activity, it worked! I rebuilt the database one table at a time, and all posts were restored intact (comments were another story, I didn’t want to import all that comment spam into the database again). At this point I could log in to my admin panel and write a post, but a good number of other things were still broken. Here you really start appreciating the excellent open source project with a wide user base and great community support and loyalty that Wordpress is. A bit of Googling solved most of the remaining problems, including:
- Not being able to log into the admin dashboard after changing the WP installation directory. I found someone who went through a similar ordeal and got linked to a solution that can be found here.
- Comment forms leading to a blank page and comments being posted. A solution was also found here
A few minor things remain broken that I am going to work on this weekend (some plugins, links referring to the old url, etc.) but nothing as important or irreplaceable as the whole post history of this blog. In the grand scheme of things, this is not an important blog, but its mine. As all of my fellow bloggers can probably imagine, losing it in a flash would’ve sucked, big time.
Until the next data disaster.
Yours truly,
Hani



1 Response to And we’re back! How I broke my blog and brought it back from the dead
Khaled
September 30th, 2007 at 3:22 am
man that’s a scary story
u gotta tell me how to backup my wordpress stuff, I don’t wanna go through the same story!
And good work with the domain name