Doh - deleted ~600 comments ...

| No Comments

From the man-I-didn't-want-to-spend-two-hours-on-that department:

I managed to delete all the comments submitted in the last 2-3 weeks yesterday. I'll hack up a script to parse them out of the HTML and put it back into the database, but I didn't run it yet... Anyway, your comments should be back later today.

If you accidentally delete your comments from your weblog, before you do anything else make a backup of the generated HTML files.

Update: The comments are back, yay. Here's the script I hacked up. It has a bunch of hardcoded things related to my weblog, but as I'm using the standard templates it might work as a starting point for you if you deleted your comments from the database too and want to "get them back" from the html. Or not. I ran it like this from my archives directory:

find `pwd`/2004 -name \*.html | (cd ~mt/MT; xargs ~/bin/parse_comments)

I've put my backup script back in place and I recommend you do so too. My script goes like this:

#!/bin/sh
mysqldump -uroot MT |bzip2 -9 > MT.backup/MT.`date +'%Y%m%d-%H%M'`.bz2

I run it from cron a couple of times a day. Less would probably do fine, but I like it that way... :-)

Leave a comment

About this Entry

This page contains a single entry by Ask Bjørn Hansen published on January 16, 2005 11:59 AM.

Find recent content on the main index or look in the archives to find all content.

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.33-en
/* bf */