4 Oct 2007

WordPress to b2evolution import script

Filed under: My software by Hari
Posted at 10:14:28 IST (last updated: 30 Oct 2008 @ 23:00:10 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)

37 comment(s)

Leave a comment »
  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 4 Oct 2007 @ 10:21:46 IST #
  2. Ah, no problem about that RT. Thanks for offering to try it out.

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

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

    Comment by hari (blog owner) on 4 Oct 2007 @ 19:51:38 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 17 Oct 2007 @ 09:28:13 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 18 Oct 2007 @ 08:22:50 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 18 Oct 2007 @ 11:45:26 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 19 Oct 2007 @ 07:36:26 IST #


  9. Comment by tapirul (visitor) on 22 Oct 2007 @ 03:05:15 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 22 Oct 2007 @ 16:47:43 IST #
  11. thanks for the answer, I will look for it.

    Comment by tapirul (visitor) on 22 Oct 2007 @ 17:05:50 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 22 Oct 2007 @ 22:25:27 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 23 Oct 2007 @ 10:04:52 IST #
  14. didn't mean to criticize, just to understand. I'll ask on b2evolution forum

    Comment by tapirul (visitor) on 23 Oct 2007 @ 11:34:54 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 23 Oct 2007 @ 16:15:27 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-cool.

    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 30 Oct 2007 @ 00:16:44 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 30 Oct 2007 @ 08:40:07 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 30 Oct 2007 @ 22:05:48 IST #


  19. Comment by tapirul (visitor) on 30 Oct 2007 @ 22:48:50 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 31 Oct 2007 @ 08:23:38 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 31 Oct 2007 @ 09:57:39 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 31 Oct 2007 @ 10:12:45 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 31 Oct 2007 @ 12:09:33 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 31 Oct 2007 @ 14:24:30 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 31 Oct 2007 @ 23:24:50 IST #
  26. can this work with wp 2.5.1 ?

    Comment by ameo (visitor) on 10 May 2008 @ 09:22:40 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 10 May 2008 @ 10:02:35 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 30 Jul 2008 @ 22:53:16 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 31 Jul 2008 @ 22:41:45 IST #
  30. okay, thanks. I appreciate the information.

    Comment by BlueJim (visitor) on 3 Aug 2008 @ 03:32:55 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 2 Sep 2008 @ 09:44:21 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 5 Sep 2008 @ 14:36:02 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 6 Sep 2008 @ 22:20:01 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 7 Sep 2008 @ 15:50:30 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 15 Oct 2008 @ 05:55:18 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 15 Oct 2008 @ 06:00:52 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 15 Oct 2008 @ 08:20:32 IST #

Leave a comment

Your name*
Email ID*
(wont' be published)
Website
Your comments*
(No HTML allowed)
smile grin biggrin cheeky wink cool frown angry suspect oops confused straight sarcastic
Code* captcha Enter the code you see in the image
* required fields