Hari's Corner

Humour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and then

WordPress to b2evolution import script

Filed under: My software by Hari
Posted on Thu, Oct 4, 2007 at 10:14 IST (last updated: Thu, Oct 30, 2008 @ 23:00 IST)

NOTE: I no longer maintain the original version of this script as both WordPress and b2evolution have changed their database structure since b2evolution 2.0.1-alpha and WordPress 2.3. If anybody wants to maintain this script for current versions of the respective software, please feel free to take the code and incorporate it from b2evolution. Also please post your questions at the b2evolution forums as you are more likely to get active responses from there.

Here's my import script which I used to convert this blog from WordPress 2.3 to b2evolution 2.0.1-alpha. The attached file has instructions on how to convert your blog. I strong recommend that you peruse the README file before using it. This works only with WordPress 2.3 and not versions below it. If you have an older WordPress blog, please upgrade first to 2.3 before importing.

I have enjoyed using b2evolution so far as it's much more configurable than WordPress (in the admin interface) and it's more like a CMS than a blog. However, you can check for yourself. This importer does not touch your existing WordPress installation, so there is no harm in testing it out.

You can ask questions and provide your feedback here! I would appreciate it.

Download link: wp_2_b2evolution.zip (6.6 kB)

44 comment(s)

  1. I'll be trying it out in a couple of days. I have pressing obligations that won't afford me the time until then. I don't want to look and run, if you know what I mean.

    Comment by RT Cunningham (visitor) on Thu, Oct 4, 2007 @ 10:21 IST #
  2. Ah, no problem about that RT. Thanks for offering to try it out.

    Comment by hari (blog owner) on Thu, Oct 4, 2007 @ 12:12 IST #
  3. Good luck with b2evo!

    Comment by Walter Cruz (visitor) on Thu, Oct 4, 2007 @ 19:44 IST #
  4. Thanks Walter! :)

    Comment by hari (blog owner) on Thu, Oct 4, 2007 @ 19:51 IST #
  5. Thanks for the script. I will sure keep this in a safe place as i'm sure it will come handy one day.

    Say, my question is. how does b2ev differs from WordPress MU? I would like to be bale to have Multi Blog but was having problem with subdomins and wordpress MU.
    Thanks again for the script!

    Comment by M Ardat (visitor) on Wed, Oct 17, 2007 @ 09:28 IST #
  6. Hi, Ardat, I've never used WordPress MU so I don't know how the inner mechanism of multi-blogging works in that.

    I'm sure you can set up multi-blogging with subdomains in b2evolution as well but I haven't tried it myself.

    Comment by hari (blog owner) on Thu, Oct 18, 2007 @ 08:22 IST #
  7. Hari, so why did you switch from WordPress to b2ev?! See i've just started my blog couple months ago and want to make sure i'm on the right platform before I start getting busy!

    Any feedback would be appreciated. Thanks

    Comment by M Ardat (visitor) on Thu, Oct 18, 2007 @ 11:45 IST #
  8. Well, for one thing, I thought WP over the years wasn't developing in the right direction. It has got bloated since 1.5 and the features don't exactly capture the imagination.

    It's also not got the most configurable backend. A lot of WP features are hidden in PHP template code. It's not the cleanest blogging system around.

    Comment by hari (blog owner) on Fri, Oct 19, 2007 @ 07:36 IST #


  9. Comment by tapirul (visitor) on Mon, Oct 22, 2007 @ 03:05 IST #
  10. The UTF-8 characters issue is a MySQL issue. There is a script to convert the database to UTF-8.

    Search for the script in forums.b2evolution.net

    This issue can only be resolved permanently if the b2evo developers make UTF-8 the default charset and connection settings.

    Comment by hari (blog owner) on Mon, Oct 22, 2007 @ 16:47 IST #
  11. thanks for the answer, I will look for it.

    Comment by tapirul (visitor) on Mon, Oct 22, 2007 @ 17:05 IST #
  12. on a second thought... I've already set my database on UTF-8 (before the conversion), I am running three forums and three blogs (two on WP) with no problems in displaying the Romanian characters. The Romanias characters are correctly recorded in my tables (did a search), so I thought it might be your transfer script that creates tables not in UTF-8. Or something. I don't know much about php scripting and SQL, though.

    Comment by tapirul (visitor) on Mon, Oct 22, 2007 @ 22:25 IST #
  13. My script does not create any tables or databases. It just transfers records from WP to b2evolution

    Comment by hari (blog owner) on Tue, Oct 23, 2007 @ 10:04 IST #
  14. didn't mean to criticize, just to understand. I'll ask on b2evolution forum

    Comment by tapirul (visitor) on Tue, Oct 23, 2007 @ 11:34 IST #
  15. No problem. I didn't take it the wrong way. Just wanted to clarify that my script doesn't convert the tables to UTF-8 format.

    Comment by hari (blog owner) on Tue, Oct 23, 2007 @ 16:15 IST #
  16. me again.
    It worked well with the info on b2evolution forum on how to change to utf-8 (I only had to edit a php file, the database was already converted tu utf-8).

    Now, I tried several time to convert a blog from WP and it works fine up to comments - it cannot convert the comments, for some reasons. It converts about 10 comments and it stops. Any idea? What kind of info do you need?

    Comment by tapirul (visitor) on Tue, Oct 30, 2007 @ 00:16 IST #
  17. Hmm... strange. I have no idea why this should be so. If importing everything else works, comments should work too.

    By the way how many comments do you have? Is the script getting timed out on your server? Do you get any other error messages?

    Comment by hari (blog owner) on Tue, Oct 30, 2007 @ 08:40 IST #
  18. I get no error message, it just says that comments couldn't be imported (doesn't go further to users).
    There are about 1,100 comments; I wouldn't think it gets timed out, it takes less than other scripts I might run (restoring a database let's say) - it takes about, say, 10 seconds.

    Comment by tapirul (visitor) on Tue, Oct 30, 2007 @ 22:05 IST #


  19. Comment by tapirul (visitor) on Tue, Oct 30, 2007 @ 22:48 IST #
  20. The problem is not with the query itself. Something in the comments data must be a problem.

    Try this: take a back up of your WP database. Then just delete the single comment at which you are getting this error and try again. You said your were about to import about 10 comments before the problem occured. You might be able to find out exactly what in that comment causes the issue.

    Otherwise I don't know. I need the data to debug the problem and help you resolve the problem.

    Comment by hari (blog owner) on Wed, Oct 31, 2007 @ 08:23 IST #
  21. thanks for the help. it's good to know that the query is ok. I'll try what you told me.
    Thanks again

    Comment by tapirul (visitor) on Wed, Oct 31, 2007 @ 09:57 IST #
  22. Yes, this site was converted from WP to b2evo using my script.

    If you find any particular character in the comment record which has interfered with the query, let me know. I think you should have imported the data first before converting to b2evolution to Unicode. Also what is your version of MySQL and PHP?

    Comment by hari (blog owner) on Wed, Oct 31, 2007 @ 10:12 IST #
  23. MySQL 4.1.. I am not sure about PHP, but I would expect a newer version...
    (on phpMyAdmin i have this message, though, Your PHP MySQL library version 5.0.32 differs from your MySQL server version 4.1.11. This may cause unpredictable behavior, but I don't have other problems)

    The data base is already UTF-8

    The posts were all imported, with the correct characters (after doing the changes suggested here http://forums.b2evolution.net/viewtopic.php?t=10992

    Comment by tapirul (visitor) on Wed, Oct 31, 2007 @ 12:09 IST #
  24. Well, I've seen strange MySQL errors which occur with regard to different versions. So you might want to test this out with MySQL 5 separately (if you can).

    See if it is related to MySQL. By the way, did you get it working?

    Comment by hari (blog owner) on Wed, Oct 31, 2007 @ 14:24 IST #
  25. oh, not yet, I've been caught with other things.
    I am running the blogs on my university's server (I am a student, and we have some webspace alloted), so I cannot test it somewhere else.
    I'll try again as soon as possible and let you know.

    Comment by tapirul (visitor) on Wed, Oct 31, 2007 @ 23:24 IST #
  26. can this work with wp 2.5.1 ?

    Comment by ameo (visitor) on Sat, May 10, 2008 @ 09:22 IST #
  27. ameo, I'm not sure. If the database structure of WP hasn't changed it might work.

    Then again, the b2evolution database might also have changed.

    Comment by hari (blog owner) on Sat, May 10, 2008 @ 10:02 IST #
  28. Hello,

    I am wondering where the import comes from. I mean, from a wordpress install on my domain, or from a xml file I upload ?

    I checked the readme, and it said to make sure both wp and b2e were installed correctly.

    I have wp 2.6. and b2e 2.4.2. Just not in the same part of my domain. The site I want to convert to b2e is a sub-domain.

    Thanks,
    Jim

    Comment by BlueJim (visitor) on Wed, Jul 30, 2008 @ 22:53 IST #
  29. BlueJim, this works with a much older version of wordpress and b2evolution. It converts the database directly and not the XML file.

    I've not updated the script for later versions of Wordpress to b2evolution.

    Comment by hari (blog owner) on Thu, Jul 31, 2008 @ 22:41 IST #
  30. okay, thanks. I appreciate the information.

    Comment by BlueJim (visitor) on Sun, Aug 3, 2008 @ 03:32 IST #
  31. OK so I filled out your form (I had to make a new WP install to import my old stuff into) and then that gave me all of the info your form asked for...

    but your machine thinks the error message is spam...

    can someone write me so I can send more details of the error message

    Comment by Sue (visitor) on Tue, Sep 2, 2008 @ 09:44 IST #
  32. Sue, what version of WordPress are you using? This converter works only for WordPress 2.3 to B2evolution 2.0.1 Alpha

    Comment by hari (blog owner) on Fri, Sep 5, 2008 @ 14:36 IST #
  33. Your importer is fantastic but it needs a little bit of a FAQ for users. My friend struggled with it for hours before she figured out the database user needs to have access to both the b2 database and WP database to get this to work.

    Comment by Daethian (visitor) on Sat, Sep 6, 2008 @ 22:20 IST #
  34. Hi, Daethian, I don't remember specifically asking for both the WP database username and password as well as the b2evolution database and password. I'll have to check it out again because it's a been a while since I've used it.

    Comment by hari (blog owner) on Sun, Sep 7, 2008 @ 15:50 IST #
  35. Hi
    I've been attempting to use your script all evening and I've had absolutely no luck at all.

    I filled in the correct info for the username and database info and still it error's out.

    http://foundationsound.co.uk/blog/
    this is the blog where I am working.

    the database error is:

    WordPress database name is incorrect. Please check the name and try again.

    I created a database user and the password to be sure of each. so I am not sure why this error is given.

    I would really like to use your script as I have the intention to move all of my blogs from wp as it causes my blogs and seperated domains to be down alot due to sql timeouts.

    thank you in advance for your response

    Comment by RE Ausetkmt (visitor) on Wed, Oct 15, 2008 @ 05:55 IST #
  36. Hari,
    I wanted you to also see this error which I've gotten many times.

    I filled in my password, and instead the word yes appears to have been put in place of my password.

    help please,
    TIA

    ____________________________

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'badgalsr_b2e01'@'localhost' (using password: YES) in /home5/badgalsr/public_html/foundationsound/blog/inc/tools/wpimport.ctrl.php on line 116

    Error connecting to MySQL. Please check whether the server is running and the host, username and password fields are correct!

    Comment by RE Ausetkmt (visitor) on Wed, Oct 15, 2008 @ 06:00 IST #
  37. Hi,

    the error is most likely due to the fact that you're using a different username and password for accessing your WP database and your b2evolution database.

    "Using password: YES", means that a password is being used, not that the password is YES.

    I think you should configure your database such that both the WordPress database as well as the B2evolution database is accessible by the same MySQL user.

    Also this script works only for b2evolution 2.0.2 alpha and WP 2.3 and not for versions above it, because the database structure of both WP and b2evolution has changed since then.

    Comment by hari (blog owner) on Wed, Oct 15, 2008 @ 08:20 IST #
  38. Hi, I am trying to transfer my wife's blog from wordpress to B2evolution, using your wordpress importer in the misc section of tools in admin. I'm getting limited success, some posts are turning up but others arent, some are turning up in the b2 admin but not posted.
    The screen at the importer looks like this: Trying to import categories and tags:
    Reading cat: Home
    Reading cat: Dean stuff
    Categories inserted successfully!
    Tags inserted successfully!
    Trying to import posts
    Reading:
    Reading: Crafts
    Reading: About Begin-Again Blog
    Reading: Xmas!!
    Reading: Halloween
    Reading: US
    Reading: Website
    Reading: Tips
    Reading: Eurovision
    Reading: Faves
    Reading: About
    Reading: LIFE
    Reading: NEWS!!
    Reading: Spooks or spoofs?
    Reading: Peeves!
    Reading: It's beginning to look (and feel!) a lot like Christmas!
    Reading: A Big Worldwide Welcome!
    Reading: Hair-do's, holidays and hustle bustle!
    Reading: Ta Da! Houston We Have Liftoff!! Website is up!!
    Reading: Perfume
    Reading: Fave Christmas Songs and why
    Reading: Least fave Christmas Songs and why
    Reading: Your Xmas Traditions
    Reading: Xmas traditions around the world
    Reading: Your Festive Recipes
    Reading: What you love most about Christmas
    Reading: Halloween 2008
    Reading: After Halloween...
    Reading: Shooting fish in a "Medium" sized barrel
    Reading: Complaints!!!
    Reading:
    Reading: Christmas?? What Christmas???
    Reading: New Year - New start?
    Reading: Eurovision - Eurowhat??!!
    Reading: Totem Ta Dah!!!
    Reading: Traffic rank widget!
    Reading: NEWSFLASH! - OUR NEW ADVICE & GUIDANCE SERVICE LAUNCHED TONIGHT!!
    Reading: Good news and bad this week!
    Reading: Coming Soon...
    Reading: Sad week
    Reading: New happenings and brand-new competitions on the Forum!
    Reading: We're moving out...
    Reading: Norway - douze points!!!
    Reading: New home - whole new world!
    Reading: Brand-new shiny Party Plan Manager!!
    Reading: Sad news - considering closing the Forum
    Reading: Mixed Week
    Reading: Begin-Again Competition on Forum up and running!
    Reading: Big news! Begin-Again goes to Tynemouth Market!!
    Reading: This little Blogwriter went to Market!

    Inserting:
    ** WARNING: generated automatic slug: 85-
    Inserting: Crafts
    ** WARNING: generated automatic slug: 104-Crafts
    Inserting: About Begin-Again Blog
    ** WARNING: generated automatic slug: 137-About-Begin-Again-Blog
    Inserting: Xmas!!
    Inserting: Halloween
    Inserting: US
    Inserting: Website
    Inserting: Tips
    Inserting: Eurovision
    Inserting: Faves
    Inserting: About
    Inserting: LIFE
    Inserting: NEWS!!
    Inserting: Spooks or spoofs?
    Inserting: Peeves!
    Inserting: It's beginning to look (and feel!) a lot like Christmas!
    ** WARNING: generated automatic slug: 97-It-s-beginning-to-look--and-feel---a-lot-like-Christmas-
    Inserting: A Big Worldwide Welcome!
    ** WARNING: generated automatic slug: 258-A-Big-Worldwide-Welcome-
    Inserting: Hair-do's, holidays and hustle bustle!
    ** WARNING: generated automatic slug: 283-Hair-do-s--holidays-and-hustle-bustle-
    Inserting: Ta Da! Houston We Have Liftoff!! Website is up!!
    Inserting: Perfume
    Inserting: Fave Christmas Songs and why
    Inserting: Least fave Christmas Songs and why
    Inserting: Your Xmas Traditions
    Inserting: Xmas traditions around the world
    Inserting: Your Festive Recipes
    Inserting: What you love most about Christmas
    Inserting: Halloween 2008

    string(1684) "INSERT INTO evo_items__item (post_ptyp_ID, post_ID, post_main_cat_ID, post_creator_user_ID,
    post_lastedit_user_ID, post_datestart, post_datecreated, post_datemodified, post_status,
    post_locale, post_content, post_excerpt, post_title, post_urltitle, post_comment_status,
    post_renderers)
    VALUES ("1", "65", "1", "1", "1", "2008-10-25 13:14:29", "2008-10-25 13:14:29", "2008-10-26 14:18:52", "published", "en-US", "<p style=\"text-align: justify;\"><span style=\"color: #c80d24;\">So, let me hear what you guys are up to this Halloween...not a very exciting night for us, althought my hubby is as we speak buying turnips for us to TRY carving out. (I am not too hopeful that my tiny girly wrists are up to the job, but onwards and upwards! I may just end up \"directing\" him on how to carve mine out...interspersed with comments like, NO! Left a bit! Make the mouth more scary!! That kind of thing!)</span></p>\r\n<p style=\"text-align: justify;\"><span style=\"color: #c80d24;\">I happen to know that my good friend Anna has a whole Halloween shindig planned as Terry is going all out complete with Halloween themed meal. Sounds Yum!!</span></p>\r\n<p style=\"text-align: justify;\"><span style=\"color: #c80d24;\">I hope we will get to see the pics up on here.</span></p>\r\n\r\n<h3 style=\"text-align: center;\"><span style=\"color: #98091b;\">So come on in, join in the spooky fun and tell us all about Your Halloween!</span></h3>\r\n<h3 style=\"text-align: center;\"><span style=\"color: #942828;\">Anyone watching Most Haunted Live???</span></h3>", "", "Halloween 2008", "halloween-2008", "open", "b2evSmil.b2evALnk.b2WPAutP");"

    Any ideas? Thanks for any help you can give. (If you need any perfume oils or aftershave balms, or stuff from our shop, I will happily chuck you a 20% off voucher in gratitude.)

    Comment by Dean Teasdale (visitor) on Wed, Sep 2, 2009 @ 22:14 IST #
  39. Dean, it's been almost 2 years since I looked at this script and the database of both WP and b2evolution have changed considerably since then. I think you would be better off if you posted a support request at the b2evolution forums because I really have forgotten most of the work I did in relation to this converter now.

    http://forums.b2evolution.net

    Regards.

    Comment by Hari (blog owner) on Thu, Sep 3, 2009 @ 08:06 IST #
  40. I had used everything, and everything goes just fine.

    Even the importer shows that it has imported each and every post by giving entity report but when i log onto Wordpress, there is nothing imported.

    I have rechecked so manytimes that both are installed in the same Database..and etc.

    Comment by Talha (visitor) on Fri, Nov 20, 2009 @ 13:50 IST #
  41. Talha, script is really outdated now and is no longer being supported. Please ask in the b2evolution forums for any updated or maintained version of a Wordpress conversion script.

    Comment by Hari (blog owner) on Fri, Nov 20, 2009 @ 18:23 IST #
  42. Hello Hari,

    I am about to convert my VB forum to Wordpress and was looking for an easy solution rather then cut and paste - that's when I noticed your comment below.

    Would you be interested in doing this and if so, how much would your charge? Perhaps you can point me in the right direction? Had to ask and noticed you were online.

    Thanks!

    Jim

    It's not really a big issue if you're familiar with PHP/MySQL and you know exactly what elements to map to what and what data wouldn't make sense to convert and can be safely ignored.

    E.g.

    Forums/subforums - > categories/sub-categories
    threads - > blog entries
    thread replies - > comments to entries
    users - > blog subscribers/registered users
    admin/mod - > blog admin/content creators

    etc. etc.

    Then you have to find out which data to export to WP and which to remove. It's not really a pain, but you need to know exactly how you're going to map.

    The actual script will take around a day or so to program if you know PHP/MySQL well enough.


    Comment by Jim (visitor) on Wed, Nov 3, 2010 @ 04:46 IST #
  43. Moved the above comment to a more appropriate topic of discussion

    Jim, I know it could be possibly done and I've done something similar blog software (WP -> b2evolution) before, but right now I don't have the time or inclination to investigate the issue deeper as I am busy with studies.

    Perhaps you could make a request at the WordPress forums or developers' community for a script and somebody interested enough might take it up. Also currently I don't have a copy of vbulletin (the latest version that is) to pursue this conversion problem.

    Sorry I couldn't be of more help to you. Best option is to look to the WordPress development and mod community at wordpress.org.

    Comment by Hari (blog owner) on Wed, Nov 3, 2010 @ 09:33 IST #
  44. Thanks for the response Hari! I figured as much, but had to ask :)

    Good luck on your studies!

    Comment by Jim (visitor) on Wed, Nov 3, 2010 @ 18:52 IST #

Comments closed

The blog owner has closed further commenting on this entry.