't Bijstere spoor

't Bijstere spoor

A blog about Web development

Comments are back!

Thanks to a suggestion from Mohammad Lahlouh, all deleted comments are restored. Thanks!

I was able to do this with the mysql binlog, which is a binary log containing all statements executed on the server. If you face a similar problem, here are the steps to restore the DB:

  1. See if you're actually storing binlogs. For me this happened to be the case, although I never actually payed attention (My friend Jens Meijer is so kind to provide hosting for me). In my case they were stored in /var/log/mysql.
  2. Grab your latest backup. In my case it was from October 2008.
  3. Make sure you also create a new backup, just in case this process goes wrong.
  4. Restore your old back.
  5. Find the binlog that corresponds to the date of your backup. I did a simple copy of the ~300 binlogs to a different directory.
  6. Run the binlog through 'mysqlbinlog' and pipe into a new file. I had to append the --database argument, because I wasn't interested in all the other databases. The full command for me was mysqlbinlog mysql-bin.* --database evert2 > commentsbinlog.sql
  7. .
  8. Open the new file, and make sure the first queries are correct. Likely there are some updates/inserts/deletes on top of the file that were already part of your last backup.
  9. Go all the way to the bottom of the file, and remove the offending queries. In my case I had to remove the query that deleted all my comments.
  10. Apply the sql file to your database: mysql -u root -p evert2 < < commentsbinlog.sql

It's wise to assure nobody can access the DB while you are doing this. I hope this helps anyone else with this problem.


Blogging for 3 years

I just realized I've been blogging for 3 years now, so it's time for my annual meta-blogging post :).

I've managed to come up with 50 mildly interesting topics since the 2 year mark, so that's pretty close to a 1 post per week average. Not bad, but a drop of 4 posts since the last.

Thanks very much for reading, I'm always really happy to see people linking or dropping comments, if there's any improvements I can make in my writing definitely let me know.


Blogging for 2 years

This blog is now up for 2 years!

Quite happy with the results so far, its getting tough to always come up with a new post (and have been slacking in the last month a little bit), but by forcing myself to keep this active I've managed to come up with some open source projects, and grow as a person.

Some lame stats:

  • Wrote 54 posts this year, 48 last year; so there's a slight growth =)
  • According to awstats there were 12912 uniques in april 2008, versus 6296 uniques in april 2007. The actual number is probably way under that will all the spambots and such; but still happy to know some people read it.
  • I've maintained this blog longer than any girlfriend (yes, that's how dedicated I am =P ).
  • I've gotten 466 legit comments, and 1525 spam comments that made it through the captcha (thanks so much!).

Thanks for reading and the critique!


Blogging for 1 year

Usually I will refrain myself from meta-blogging, so I'll just keep it short..

Can't believe its still up.

laughing man