Categories
server admin

WordPress blog no backup, restore posts?

Well, obviously, it ain’t possible, but sometimes you can do it using Google…

My most recent backup was a few weeks ago, so I’d lost a few posts, and I wanted them back. The wonderfully efficient linux stopped writing anything to the hard drive, which I didn’t find out about until I came to do my regular backup and all the backup utils weren’t working – they all write to the hard disk temporarily.

So, I’ve got a new hard disk and done a complete restore. HOWEVER, MySQL is – still – very flakey unless/until you manually massage its config. (this is why you should always hire a DBA who is good at their job – game developers who reckon they can “work it out themselves” when it comes to databases are cruising for a bruising, and tend to end up being laughed at by everyone else). It managed to sufficiently screw up that it deleted THREE WEEKS of posts to this blog. Posts that should have been written to disk a very long time before the hard disk failure (hard disk didn’t fail until this week, and other writes on the blog – e.g. the comments – from the start of this week WERE saved by MySQL). Normally, on a commercial site, I would have taken the days / weeks to optimize and fix the MySQL config to prevent issues like this; not worth the time on a private blog.

But … this is probably the case (or worse) for most people running WordPress blogs, very few of whom are qualified to do manual tweaking of MySQL, and – IME – very few of the hosting companies they use employ people smart enough to do it either. Never believe a hosting company that says they “look after” the database setup etc for you – usually they employ the least-qualified (read: cheap) people they can get away with.

So, the posts were gone. But there is hope yet – most of them were in Google’s Cache (this is my top tip for what to do when you lose blog posts that were made since your last stable backup – google for them, and use the “cached version” link on the google results page). Interestingly, one of the posts didnt appear in google at all, because it had also been on the front page, and google was forceably ONLY returning that link – but only the excerpt was on the front page. Searching for terms which I knew were in the post body gave 0 results from google, which made me sad.

But then … a few minutes later, I tried a copy/paste of the entire post title, which is also the contents of the HTML TITLE tag (hoping I could find a spammer who’d linked to it and stolen the complete text), and found that THAT was in fact in google, with the full cached copy of the page. It was odd that I got zero hits for something that clearly was in the cache. Anyway – searching on page title seems a good thing to try in future if you get problems with this.

1 reply on “WordPress blog no backup, restore posts?”

Comments are closed.