* * *
I'm releasing the PHP script I wrote to migrate my b2 blog engine installation (version 0.6) to WordPress (version 2.0.2) in hopes that it might be useful to any other bloggers who are still stuck with their b2 installations for various reasons.
I decided to write my own script to carry out the migration as the latest WordPress release doesn't contain one and the only other alternative, apparently, would have been to go through a ridiculous series of upgrades (without any guarantees, as I had heavily hacked my b2 installation.) I wasn't interested in keeping my hacks (in fact, no more hacking -- from now on I can create lovely WordPress plugins if I want to add new functionality) but I did want to keep the list of users, posts, categories and comments.
So, without further ado, here's the b2 to WP migration script (b2towp.zip; 19kb).
INSTRUCTIONS
Important: Make sure you have a backup of your b2 database. I recommend that you carry out this procedure on a development box first to make sure you're happy with the results.
- Use PHPMyAdmin to export your b2 database into an SQL file.
- Install WP 2.0.2
- On the machine you installed WP, use PHPMyAdmin to create a database for your b2 database and inport it from the SQL file you created in Step 1.
- Open the b2towp.php file in an editor and enter the database connection info for both the b2 and WP databases at the head of the file.
- Run the b2towp.php script
That should be it. Remember that this script migrates your users, posts, categories and comments only.
The script is released under CC-GNU GPL.
The b2 to WordPress migration script article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.
[...] b2 to WordPress migration script Migrate from b2 to Wordpress in one step. Technorati Tags: b2 migrate wordpress [...]
Does this also work for HUGE databases? I have a WP blog and a B2 archive that I would like to merge..
Hey Grobbo — not sure how you define “HUGE” :) The export of my FlashAnt database was 2mb uncompressed. The only issue I can think of as to why it wouldn’t work would be a script timeout or memory issue. You can change the former in the PHP settings and probably add more RAM for the latter :)
Let me know how you get on good luck!
[...] Here is a very useful tool to migrate from B2 evolution to the current versions of wordpress [...]
I have been thinking since forever if I should convert my beloved b2 to Wordpress. I have bookmarked your site for now, and I will most likely give in sooner than later, as the spam is unmanagable with b2. What a shame. Thank you for sharing!
Hi Aral,
I have decided to give it a shot, and converting went smoothly, except for the comments. I get this error:
Clearing the comments table… failed.
Inserting comments and updating comment counts in posts table
Warning: Invalid argument supplied for foreach() in /…blah…/convert/b2towp.php on line 385
Which would be // Stats, which again doesnt make much sense to me.
Do you have any suggestions?
Thank you so much in advance!
[...] Here is a very useful tool to migrate from B2 evolution to the current versions of wordpress This entry was posted on Friday, May 12th, 2006 at 2:38 pm and is filed under do you do web. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site. « sitecheck : funkybunny.com what you looking at? » [...]
Worked beautifully. Thank you so very much!
You’re very welcome — great to hear! :)
Worked like a fucking charm, I salute you.
Great to hear, Jay! :)
this is fantastic! thank you so much for this! ive been looking high and low for a way to import my old stinky b2 database.
[...] Download the b2 to WP migration script (b2towp.zip; 19kb) [...]
Thanks! Just imported from b2 v0.6pre to Wordpress 2.1.3.
Hi Jeff, roycifer,
Great news, guys! :)
[...] 的0字节文件了。 也有人为 Wordpress 2.0.2 开发了迁移程序,看 这里 还有 这里 ,将 代码 [...]
[...] 的0字节文件了。 也有人为 Wordpress 2.0.2 开发了迁移程序,看 这里 还有 这里 ,将 代码 [...]
[...] really like to thank Aral Balkan and and his b2 to wordpress conversion script which was more than a [...]