Convert a b2evolution blog to WordPress
Feb 21st, 2007 by RealNitro
About a week ago I decided to move my blog from b2evolution (hosted by Ikke) to WordPress. I found a convertor-script here, but it didn’t work for my version of b2evolution (and WordPress). So I started hacking away with my beginner-php-skills and adapted the script.
Some ‘features’:
- It transfers your user, posts, comments and categories
- Comments by b2evolution blog members are translated to normal comments, using the nicknames, e-mailadresses and url’s from the users table.
- Several changes from the original script to support the current versions of b2evolution and WordPress.
One problem with this script is that post and category ‘names’ are not converted. I forgot to convert them and fixed them manually in the database as I found out about it when my blog was almost ready. If you want to use fancy urls with your post or category name in them, you will have to change the script to convert them from b2evolution, or just add them manually. Changing the script isn’t a lot of work, but I just don’t feel like reďnstalling WordPress just to test that feature. (I know, I’m lazy.
)
A quick howto:
- Install WordPress on your server. If you can visit your WordPress blog and read the standard WordPress post, you’re ready to go.
- Upload the script to your server, and rename it to b2evo2wp.php
- Surf to the file you just uploaded, fill in the required fields, and if you’re lucky, it all works…
Good luck, and let me know how it turned out.

Ok, so if I were going to fix that, what do I need to change?
Well, if you check the ‘(evo_)posts’ table in your b2evo database, there is a field called ‘post_urltitle’. This needs to be mapped to ‘post_name’ field in the ‘(wp_)posts’ table in your WordPress database.
For the categories, the ‘(evo_)categories’ table has a field called ‘cat_name’ that needs to be mapped to the ‘category_nicename’ field in ‘(wp_)categories’.
I updated the script. I didn’t test it, so I’m not sure if it will work.
If you want to change things manually, you can give the categories ‘nicenames’ using the WordPress admin panel. Go to Managa->Catergories, click Edit, and fill in the ‘Category slug’ field. For the posts, go to Manage->Posts, click Edit, expand the ‘Post slug’ box on the right, and fill in the slug.
The prefix thing doesn’t work, one of the lines has:
select option_value from wp_options
Fix that and replace it with:
select option_value from ” . $wp_pref . “options
lappy512: thx for letting me know. I updated the script. The newest version is b2evo2wp_update2.php.txt.
Just tried to run your updated script and got this error when actually tried the import:
SQL : SELECT DISTINCT evo_users.* FROM evo_users, evo_posts WHERE evo_users.`ID`=`post_author` AND `user_login`’admin’
Since I don’t know a thing about this stuff, it could be user error rather than a problem with the script. My installed b2evolution software is 1.9.3 while I just installed the latest WP.
Diane, I can’t figure out what is going wrong. It seems to me the error you posted isn’t complete. Is there any more error output?
This is all the page says:
All right sparky, this is where the actual import takes place! Do you feel lucky today? :p
Importing User records …
Invalid query:
SQL : SELECT DISTINCT evo_users.* FROM evo_users, evo_posts WHERE evo_users.`ID`=`post_author` AND `user_login`’admin’
That’s it. The rest is a blank page.
Just noticed that the error I’m getting above is the same error that caused you to rewrite the original script from Appleyard’s blog. Possibly this means that the newest b2evo has once again made the script obsolete. I certainly hope someone finds out how to bring it up to date again. I’d really like to switch my blog over.
I think you’re still using the old script from Appleyard’s blog. There is no other way that you would get that error… I suggest you (re)download this script, copy it to your server, rename it to ‘b2evo2wp.php’ (as mentioned here) and it should work fine.
I am trying to use the script - understand that I am a newbie to PHP. I get the following error:
b2Evolution file path: http://benoit.marcoux.ca/blog/media/
WordPress file path: /
Importing User records …
0 User record(s) imported!
Importing Category records …
Invalid query: Table ‘bmarcou_wordpress.wp_categories’ doesn’t exist
SQL : INSERT INTO `wp_categories` (`cat_name`,`category_nicename`,`category_description`) VALUES (’Général’,'Général’,”);
Can you help me?
Thx
Benoit: Did you install wordpress on your server before using my script?
same error for me
Getting a 404 error. Any idea?
Wordpress already installed before using script.