WordPress to b2evolution import script

Posted at 10:14:28 am by hari under My software (1696 views)

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)

27 comments

GravatarComment from: RT Cunningham [Visitor] · http://www.untwistedvortex.com/
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.
Thursday Oct 4, 2007 @ 10:21
GravatarComment from: hari [Member] · http://literaryforums.org
Ah, no problem about that RT. Thanks for offering to try it out.
Thursday Oct 4, 2007 @ 12:12
GravatarComment from: Walter Cruz [Visitor] · http://b2evolution.waltercruz.com
Good luck with b2evo!
Thursday Oct 4, 2007 @ 19:44
GravatarComment from: hari [Member] · http://literaryforums.org
Thanks Walter! :)
Thursday Oct 4, 2007 @ 19:51
GravatarComment from: M Ardat [Visitor] · http://PeopleSoftGeeks.com
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!
Wednesday Oct 17, 2007 @ 09:28
GravatarComment from: hari [Member] · http://literaryforums.org
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.
Thursday Oct 18, 2007 @ 08:22
GravatarComment from: M Ardat [Visitor] · http://PeopleSoftGeeks.com
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
Thursday Oct 18, 2007 @ 11:45
GravatarComment from: hari [Member] · http://literaryforums.org
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.
Friday Oct 19, 2007 @ 07:36
GravatarComment from: tapirul [Visitor]
a great plugin, so good b2evolution 2.0.2 integrated it.

Only one issue I have with it (and maybe you can help me solve it).
I run a blog in Wordpress that has a lot of Romania characters (such as ăîâţş). The converter did not convert these characters (are replaced with "?"). Any idea what can I do to import the romanian characters/ Should I change something in the database?
Thanks
Monday Oct 22, 2007 @ 03:05
GravatarComment from: hari [Member] · http://literaryforums.org
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.
Monday Oct 22, 2007 @ 16:47
GravatarComment from: tapirul [Visitor]
thanks for the answer, I will look for it.
Monday Oct 22, 2007 @ 17:05
GravatarComment from: tapirul [Visitor]
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.
Monday Oct 22, 2007 @ 22:25
GravatarComment from: hari [Member] · http://literaryforums.org
My script does not create any tables or databases. It just transfers records from WP to b2evolution
Tuesday Oct 23, 2007 @ 10:04
GravatarComment from: tapirul [Visitor]
didn't mean to criticize, just to understand. I'll ask on b2evolution forum
Tuesday Oct 23, 2007 @ 11:34
GravatarComment from: hari [Member] · http://literaryforums.org
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.
Tuesday Oct 23, 2007 @ 16:15
GravatarComment from: tapirul [Visitor]
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?
Tuesday Oct 30, 2007 @ 00:16
GravatarComment from: hari [Member] · http://literaryforums.org
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?
Tuesday Oct 30, 2007 @ 08:40
GravatarComment from: tapirul [Visitor]
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.
Tuesday Oct 30, 2007 @ 22:05
GravatarComment from: tapirul [Visitor]
this is exactly what I get:

Reading: La métaphysique du moi

Notice: Undefined offset: 0 in /inc/tools/wpimport.ctrl.php on line 293
Posts and post categories imported successfully!
Trying to import comments
Comment importing failed. Please check your b2evolution installation.

Line 293 is the one after " // query to insert the posts into the b2evolution table"
Tuesday Oct 30, 2007 @ 22:48
GravatarComment from: hari [Member] · http://literaryforums.org
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.
Wednesday Oct 31, 2007 @ 08:23
GravatarComment from: tapirul [Visitor]
thanks for the help. it's good to know that the query is ok. I'll try what you told me.
Thanks again
Wednesday Oct 31, 2007 @ 09:57
GravatarComment from: hari [Member] · http://literaryforums.org
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?
Wednesday Oct 31, 2007 @ 10:12
GravatarComment from: tapirul [Visitor]
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

Wednesday Oct 31, 2007 @ 12:09
GravatarComment from: hari [Member] · http://literaryforums.org
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?
Wednesday Oct 31, 2007 @ 14:24
GravatarComment from: tapirul [Visitor]
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.
Wednesday Oct 31, 2007 @ 23:24
GravatarComment from: ameo [Visitor] · http://www.bluecirclet.com/
can this work with wp 2.5.1 ?
Saturday May 10, 2008 @ 09:22
GravatarComment from: hari [Member] · http://literaryforums.org
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.
Saturday May 10, 2008 @ 10:02

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
:!: :?: :idea: :) :D :p B) ;) :> :roll: :oops: :| :-/ :( :'( |-| :>> :yes: ;D :P :)) 88| :. :no: XX( :lalala: :crazy: >:XX
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)