20 May 2006

It seems my little b2 to WordPress migration script actually helped someone else (and, as often these things go, in turn benefited from the experience!)

Connie, who runs a blog called Turtelina's Kingdom, got in touch to say that the script was throwing up errors for her. I was just happy someone else was still on b2 and wanted to use the migration script! :) After a quick look at her database, I realized that I hadn't anticipated the use of table prefixes (as I didn't use them in my setup) and that there was a field I was expecting in the comments table that I had probably hacked onto my own installation as part of my custom comment spam antimeasures. In any case, these were quick fixes and I'm happy to report that the script worked for her and Connie's got the WordPress version of her site up and running. (And she's done an amazing job of migrating her templates over so quickly.)

Download Version 1.1 of the b2 to WordPress migration script (20kb).

Important note on b2evolution: Some people have been erroneously linking to the script as a b2evolution to WordPress migration script. I want to make it clear that this script is not for b2evolution but for the older b2 blog engine. Since b2evolution is based on b2, it is possible (but highly improbable) that the script will also work for b2evolution. If anyone has a b2evolution setup and would like to test this, I'd appreciate hearing about your experiences. If the two database setups are not hugely different, it should not be too difficult to port the script to work with b2evolution.
Release notes:

Version 1.1

  • Supports custom table prefixes for b2 and WP databases
  • I've removed a custom field from the comments table that will trip up regular b2 databases

Version 1.0

Initial release. Only tested on my own database. Do not use this version as it has known dependencies on my setup.

Add Your Comment

Spam Protection by WP-SpamFree

b2 to WordPress migration script updated

  1. [...] Update: There is a new version of the script (Version 1.1) that you should be using. Also, please note that this script is for the older b2 weblog engine not b2evolution. [...]

    b2 to WordPress migration script at Aral Balkan
  2. Switching from b2evolution to WordPress…

    Like many others, I’ve decided to ditch b2evolution in favor of WordPress.  The biggest reasons were:

    b2evolution has almost no protection against spam.  They have this goofy little centralized blacklist that’s maintained by one person a…

    Chris Brunner .com
  3. Thanks! I’m in the process of updating my old b2 site to WordPress (v2.0.3). Your script worked PERFECTLY to migrate the data … now I can concentrate on the look before swaping it in for the b2 site!

    Well Done!!

    Eric
  4. [...] Comme tout le monde à pu s’en rendre compte à la vue de ce nouveau thème c’est wordpress qui vient de remporter le grand concours de l’été « Quelle plateforme de blog êtes-vous ? ». La décision fut difficile, mais le résultat est là même si j’en ai ch***. Dotclear m’a vraiment enthousiasmé par sa simplicité d’installation et d’import de ma base de données b2. L’ensemble de la procédure est ultra simple et s’effectue en quelques clics. Par contre, il m’ait apparu à l’usage que cette plateforme ne répondait pas totalement à mes attentes surtout du fait de son ergonomie que j’estime perfectible et son côté un peu trop « jouet ». J’ai par contre énormément apprécié sa francophilie et l’aide complète et entièrement en français. Quand à Wordpress il m’a tout d’abord déçu par l’impossibilité d’importer les commentaires et les posts de mon précédent blog. Aucun outil ne servant à ce type d’import n’est inclus dans wordpress 2.0.4 et le peu d’information que j’ai pu trouver sur leur site était obsolète depuis au moins la version 1.5. J’ai donc essayé de passer de b2 à dotclear puis d’utiliser l’outil d’import de wordpress mais devant les 1050 posts et les 5700 commentaires le serveur php/sql ne tenait pas la charge et retourné une palanqué d’erreurs. Mais à force de chercher, j’ai enfin troué un outil développé par Aral Balkan. Ce fichier php m’a permis de transférer mes données de b2 à Wordpress sans trop de casse (si ce n’est les caractères accentués qui ont du mal à passer et vont me demander un travail de fond). Pour les gens qui aimerait passer de b2 à Wordpress je leur conseil d’utiliser ce script en faisant attention à ne pas uploader le dossier wp-includes contenu dans b2towp car il n’est pas écrit pour la version 2.0.4 de wordpress. Mais au final Wordpress est un outil extrêmement puissant et professionnel qui devrait me convenir pendant quelques années [...]

    Da PInGUi WeBLoG » Migration vers Wordpress
  5. I just used this and it worked like a dream.

    THANK YOU!!!!!!!!!!!!!!
    –Scott

    Scott Bechtel
  6. You’re very welcome, Scott :)

    aral
  7. tried it and it produced errors. gonna try the oldfashioned 1.2 -> 1.5 -> 2.0 method.

    kihluh
  8. Hi, I’m trying to migrate now to WordPress; however, this script doesn’t work on the newest 2.3.n version. Would this work for 2.0.11???

    Please let me know.

    Michael
  9. Sorry Michael, I haven’t tested with the latest Wordpress — I believe that may have database changes that are incompatible with it.

    Aral
  10. It seems that there’s no category table anymore. Any suggestion?

    Michael
  11. Hmm, weren’t categories replaced with tags? Perhaps renaming that in the script would work?

    Aral
  12. Category table is renamed to “taxonomy” with more columns. What should I edit?

    Michael
  13. I’m upgrading sequentially from WP 2.1.3 which seems to be working.

    BTW, the “smartToSimpleQuote”‘ function has syntax errors.

    Nevertheless, thanks for the script!

    Michael
  14. I’m upgrading sequentially from WP 2.1.3 which seems to be working.

    BTW, the “smartToSimpleQuote”‘ function has syntax errors.

    Nevertheless, thanks for the script!

    Michael
  15. [...] I’ve been trying to migrate my database to WordPress since yesterday; however, since the database schemata are quite different, I’m having a difficult time.  So, I’m gonna try upgrading sequentially from version 2.1.3 and use <a href=”http://aralbalkan.com/588″ target=”_blank”>this script</a> to migrate my b2 database.  After that, I’ll <i>try</i> to redesign the entire site which will happen sometime early next year.  I don’t have any idea for the new design yet, though. [...]

    Michael’s So-Called Life » Blog Archive » WordPress Migration
  16. [...] Install WordPress 2.1.3 and this script [...]

    Michael’s So-Called Life » Blog Archive » WordPress Migration Completed
  17. thanks pal, the script spewed out a few errors injecting b2 straight into wp 2.1.3 but i can’t see anything wrong. this was a lot less painless than the old import-b2.php i’ve used before.

    ben
  18. [...] Wordpress 2.0.2 开发了迁移程序,看 这里 还有 这里 ,将 代码 [...]

    Geng的技术角落@Yo2 » 复杂的Blog升级之路
  19. Thank you very much!!

    纹身
  20. Cheers, this still works perfectly. You’ve saved me a lot of time.

    A few errors came up but it imported the important posts and comments.

    Thanks :)

    Andrew B
  21. That’s great to hear, Andrew :)

    Aral
  22. [...] it took me a while to find this site as I doubt there are many B2 blogs still out there, but if you want to upgrade to the latest [...]

    B2 to Wordpress Conversion… - Andrew Beaton :: Blog