Changing From b2 to WordPress

Apparently the b2import documentation for changing from b2 to WordPress isn’t very clear and many who have tried to import their b2 data into WordPress have had problems. Some even opted to not use WordPress at all. That’s unfortunate. In my opinion WordPress is a superior blogging script with features b2 did not have or will ever have since b2’s developer is a part of the WordPress team. So I’ve decided to offer how I changed from b2 to WordPress without any major problems in the hope that it helps other b2 users to install and change over to WordPress with less frustration.

Since I had to move my blog to my own server I first had to export my data from the old server. That was easy enough - phpMyAdmin will even compress the data. Once I had setup my new MySQL database, I unzipped the data and just dumped the data, along with the command to create the tables, into MySQL from phpMyAdmin. Nothing hard about doing this but wasn’t sure everything would work so I uploaded all my b2 files to check. Yep, everything was just as it was on the old server, my posts and all comments where intact.

Next thing I did was to remove all b2 files (not the database and data). Then I uploaded WordPress to the same database as b2, following the instructions in the readme.html. I used the same settings as I used in the b2 database, i.e. database name, user name, password, and host. I didn’t change the WordPress table prefix “wp_” when creating the wp tables in MySQL.

After uploading WordPress I ran /wp-admin/install.php. After the install I went into phpMyAdmin and clicked on the database where I installed WordPress. My b2 and WordPress tables were all visible. I clicked on the SQL tab and put the following into the SQL query field.

DROP TABLE wp_categories;
DROP TABLE wp_comments;
DROP TABLE wp_posts;
DROP TABLE wp_settings;
DROP TABLE wp_users;
RENAME TABLE b2categories TO wp_categories;
RENAME TABLE b2comments TO wp_comments;
RENAME TABLE b2posts TO wp_posts;
RENAME TABLE b2settings TO wp_settings;
RENAME TABLE b2users TO wp_users;

Be sure that there are no spaces at the beginning and at the end within the query field. Then I hit Go. This is where it got tricky because SQL returned errors. I can’t remember exactly how the errors were worded but it basically said that it could not find specific tables. IGNORE the errors and run /wp-admin/import-b2.php from your site - http://www.mysite.com/wp-admin/import-b2.php and it will be a done deal!

I did struggle a little with the errors before I figured out that I needed to run the import file. In my phpMyAdmin the b2 tables were still there after they were supposed to be renamed. I finally thought to refreshed my browser screen and then they were gone. After that is when I decided to ignore the errors and run the import file just to see what would happen. It worked and I became a happy WordPress blogger.



28 Responses to “Changing From b2 to WordPress”

  1. chartoo:

    Very nice, glo,I like your new style.
    The graphic image of you peeking out from the bushes adds a bit of mystery to your site.

    chartoo

    chartoo

  2. Glo:

    Thanks, chartoo. Now all I need to do is get the rest of the layout done. Maybe I will be able to work on it this weekend.

  3. YJ's Blog (with a boring title):

    upgrade complete
    After an afternoon of fiddling with MySQL export functions and a mess of CSS, I’ve finally managed to upgrade this site to use WordPress. It’s quite the improvement over b2, which should be no surprise since it’s a follow-up version of the program.

  4. Glo:

    yinjie, thanks for letting me know that my instruction were helpful in changing from b2 to WP. Enjoy WP, it rocks in my opinion!

  5. Bert:

    I had some trouble as well, but your guide helped me through. Thanks, I did not encounter errors, though!

  6. Doug Moore:

    thanks so much! saved me from the spam that was taking over my b2 blog.

  7. Sumin:

    Thank you so very much! I spent hours trying to figure out how to import my faulty b2 to the ever-glorious WP… And by following your directions, I succeeded! Kudos to you!

  8. Bekki:

    Thanks so much for the tips! The renaming thing didn’t work so I just exported the b2 DB and renamed stuff in the file then ran it in. It worked then! Thanks!

  9. rashundatramble.com » Up and running, somewhat.:

    […] you know what I’m talking about. As for getting the blog itself going, I must thank Glo for sending me the link to her tips page. Just a few t […]

  10. BubblesSOC:

    […] to do so. Read the Short Tutorial… First off, I followed the instructions found on this site until I got down to this: DROP TABLE wp_categories; DROP TABLE wp_comments; D […]

  11. Inge:

    Thanks!

  12. Brigitte:

    Argh.. I did as you said and got these errors:
    WordPress database error: [Duplicate column name ‘post_excerpt’]
    ALTER TABLE wp_posts ADD COLUMN post_excerpt text NOT NULL;

    WordPress database error: [Duplicate column name ‘post_status’]
    ALTER TABLE wp_posts ADD post_status ENUM(’publish’,'draft’,'private’) NOT NULL, ADD comment_status ENUM(’open’,'closed’) NOT NULL, ADD ping_status ENUM(’open’,'closed’) NOT NULL, ADD post_password varchar(20) NOT NULL;

    That went well! Now let’s clean up the b2 database structure a bit…

    WordPress database error: [Can’t DROP ‘ID’. Check that column/key exists]
    ALTER TABLE wp_posts DROP INDEX ID

    One down, two to go…

    So far so good.

    WordPress database error: [Can’t DROP ‘post_karma’. Check that column/key exists]
    ALTER TABLE wp_posts DROP post_karma

    Almost there…

    WordPress database error: [Can’t DROP ‘ID’. Check that column/key exists]
    ALTER TABLE wp_users DROP INDEX ID

    WordPress database error: [Unknown column ‘post_name’ in ‘field list’]
    SELECT ID, post_title, post_name FROM wp_posts WHERE post_name = ‘’

    WordPress database error: [Unknown column ‘category_nicename’ in ‘field list’]
    SELECT cat_ID, cat_name, category_nicename FROM wp_categories

    Warning: Invalid argument supplied for foreach() in /home/dakishi/public_html/log/wp-admin/upgrade-functions.php on line 30

    WordPress database error: [Key column ‘post_name’ doesn’t exist in table]
    ALTER TABLE `wp_posts` ADD INDEX ( `post_name` )

    WordPress database error: [Key column ‘category_nicename’ doesn’t exist in table]
    ALTER TABLE `wp_categories` ADD INDEX ( `category_nicename` )

    WordPress database error: [Key column ‘comment_approved’ doesn’t exist in table]
    ALTER TABLE `wp_comments` ADD INDEX ( `comment_approved` )

    WordPress database error: [Unknown column ‘post_date_gmt’ in ‘field list’]
    SELECT MAX(post_date_gmt) FROM wp_posts

    WordPress database error: [Unknown column ‘guid’ in ‘field list’]
    SELECT ID, post_title, post_content, post_excerpt, guid, post_date, post_name, post_status, post_author FROM wp_posts

    WordPress database error: [Unknown column ‘comment_type’ in ‘field list’]
    UPDATE wp_comments SET comment_type=’trackback’, comment_content = REPLACE(comment_content, ‘’, ‘’) WHERE comment_content LIKE ‘%’

    WordPress database error: [Unknown column ‘comment_type’ in ‘field list’]
    UPDATE wp_comments SET comment_type=’pingback’, comment_content = REPLACE(comment_content, ‘’, ‘’) WHERE comment_content LIKE ‘%’

  13. Fiona:

    YOU RULE *hugs* :) thankyou. You just stopped me being attacked by a mob :p

  14. emilio:

    Have a b2 blog written in spanish and things are getting messy when importing to WP… characters changing to weird ones, database conflict with wordpress scripting. Think it’s because of spanish special characters. Had someone experienced something like this before? Any help will be welcomed…SOCORRO!!!

  15. glo:

    Sorry but I really can’t help you with the language thing. I doubt it’s a WordPress problem, probably more of a MySQL problem. I did have some strange character changes in my posts when I moved from b2 to WordPress but was told by a PHP and MySQL expert friend that it was an issue with MySQL.

  16. Saz:

    Fantastic! I have stuck with b2 for years, but recent comment spamming has FINALLY made me decide to migrate to Wordpress. The way they tell you how to do it doesn’t work at all, but your way is perfect! Thanks so much!

  17. Glo:

    Saz, it’s good to know that my directions are still valid. WordPress has changed considerably since I changed from b2. I know you are going to like WP, if for no other reason then the anti-spam features. The WP community is very active with plugin developers and those willing to help.

    Good luck and thanks for taking the time to comment.

  18. Matt:

    Thanks for the info. I’m about the make the move over to WP…

  19. Matt:

    Where did you get your Theme from?

  20. Glo:

    The original theme, Red Autumn, is from http://themes.star-shaped.org/, which was created using the WordPress default theme, Kubrick by Michael Heilemann. I kept some of the Red Autumn theme elements but most have been changed dramatically. The graphics were created by me.

  21. JiffySpanish:

    hey, I love the wordpress theme. Where were you when I was trying to come up with my own one! hehe I nearly pulled all my hair out mucking around with these, in the end I went with a stock standard one :(

  22. car:

    is this theme easy to install ?

  23. Glo:

    car, you obviously don’t know anything about WordPress. All the themes are easy to install.

  24. Web Marketing Mentor:

    This really helped me fix a blog that had been in the too hard basket for many months, thank you.

  25. andrey:

    Thankyou. You just stopped me being attacked by a mob :p

  26. Girly:

    Really nice theme, great colours and nice header.

  27. Vern:

    I’m lost. You had a b2 blog. Was it hosted on your own server via blogger’s FTP hosting? I think that’s what you mean. And then you had to move it from your current host and just switch over all info to the WP installation in the same hosting account at your server - yes? I’m really lost. Is this what you mean? Blogger has regular blogs. Custom domain blogs. and FTP blog solutions -which one were you using to start? Thanks. Vern

  28. Glo:

    Vern, I have never used blogger. As far as I know, blogger did not have many oprtons when I started blogging. This post is three years old and may no longer help others but I leave it up just in case. It has nothing to do with blogger.

Leave a Reply

Your blog, no spam: the thorough-paced and flagrant Hash-cash.


All content is Copyrighted by Gloria Craney unless otherwise noted.
Wild Mind is proudly powered by WordPress 2.0.6 . Theme designed by Gloria
Feeds: RSS 2.0 . Comments RSS 2.0 . Atom

Bad Behavior has blocked 1655 access attempts in the last 7 days.