Today, I updated my weblog to WordPress. Mainly because I am really tired of having to manually delete spam-comments, and I hope that WordPress can handle these better than b2. The upgrading process was quite simple: downloading the .zip, unzipping, inserting the database connection settings, uploading everything, pointing to an URL, pressing next a few times, and that was that.
After that, I tried to import my b2 posts. This should be as simple as opening a certain URL, but for some reason that didn’t work too well. All I got were some MySQL errors. But fortunately, because WordPress is an continuation of b2 the database structure is really similar. The following SQL queries did the trick:
insert into wp_posts(ID, post_author, post_date, post_content, post_title, post_category) select ID, post_author, post_date, post_content, post_title, post_category from b2posts;
insert into wp_comments(comment_ID, comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content, comment_karma) select * from b2comments;
insert into wp_post2cat(post_id, category_id) select ID, post_category from wp_posts;
I also changed the URL to point to the root of my domain (ie. to http://www.davidbaakman.nl/ instead of http://www.davidbaakman.nl/weblog), the data on the site is way outdated and thus of no real use anymore. I hope to update the template of the weblog to the design of my website soon.