Migrating B2Evolution 2.4.2 to WordPress 2.9.2

by daryl on March 18, 2010

I just performed a successful blog migration for a client from B2Evolution version 2.4.2 to WordPress 2.9.2.  The blog I am speaking currently  has 577 posts and 33 categories and dates back to 2004.  In my search for a solution, I did find some useful tips online. Like me, you may have already found those pages and discovered that the solutions only work for B2EVO version 1.

Here’s the first page you find when searching google for “migrate B2Evolution to WordPress”: The (almost) complete guide to migrate b2evolution to WordPress (Oct. 29, 2007). On this page in step 2 you’ll find a link to a page that explains How to Import b2evolution Posts to WordPress (May 27, 2007). If you note the date of these articles you soon realize these instructions worked well on older versions. Don’t worry. This is still very useful information and I did use much of what was written.

Actually, I am reading some of the comments on the first page mentioned and there are some more current solutions listed there. This one looks promising: http://worth2read.org/blog/2009/01/31/import-from-b2evolution246-to-wordpress-27/. I ended up doing something similar.

Anyway, my goal was to do the following:

  1. Downgrade the B2EVO blog from version 2 to version 1. (this is the hard part)
  2. Export posts to Moveable Type.
  3. Import Moveable Type files into WordPress.

Downgrading B2EVO to version

Before you begin BACKUP your database.

Things you will need: Access to a web server with MySQL and an installation of something like phpMyAdmin installed on the same server where your blog is located.

Go to B2Evo’s release history page . I downloaded version 1.10.3 title “Key West” (direct link). It was the last release of version 1.

Install version 1 into a new directory. You will only be using this installation temporarily.  This may be obvious but you should know the database structure is different in version 1 and version 2.

Exporting Tables From B2EVO version 2 in phpMyAdmin

From phpMyAdmin go to the following tables and export them in a SQL format. Hint: The easiest way is to set up an upload directory in the phpMyAdmin settings.

  • evo_blogs
  • evo_items > evo_items__item  (this data will be copied to a table titled evo_posts)
  • evo_items > evo_items__tag (if needed)
  • evo_categories
  • evo_comments
  • evo_postcats
  • evo_sessions

Import your SQL files to B2Evo version 1

Here’s the method I used.

Note the structure of the table evo_blogs in version 1:

———————-
blog_ID
blog_shortname
blog_name
blog_tagline
blog_description
blog_longdesc
blog_locale
blog_access_type
blog_siteurl
blog_urlname
blog_notes
blog_keywords
blog_allowcomments
blog_allowtrackbacks
blog_allowblogcss
blog_allowusercss
blog_default_skin
blog_force_skin
blog_disp_bloglist
blog_in_bloglist
blog_links_blog_ID
blog_commentsexpire
blog_media_location
blog_media_subdir
blog_media_fullpath
blog_media_url
blog_UID
———————-

Delete this table before you import the SQL file. Import the SQL and then go back to the structure and match the old structure.

Follow this for the other tables mentioned above with the exception of  evo_items__item. For this one you will need to edit the SQL file. Do a find and replace like so: find “evo_items__item” and replace with “evo_posts”  then import the file and edit the structure of the table.

Anyway, you get the general idea.

Export Posts in B2Evo version 1 to Moveable Type

Navigate to your B2Evo verion 1 installation.  Your blog should be readable.  If you get an error related to skins go to the admin area and select a skin for each of your blogs.

Now you can use the instructions found here which involves:

  1. Apply a new skin to B2Evo version 1
  2. Download your old blog to text files
  3. Import the text files to WordPress

If all is well, all of your posts and categories should be visible.  URLs to your images will be in the original location. I recommend keeping them there and then using the WordPress image directory for posts moving forward.

Read information on how to convert your permalinks here.

A quick note about the Rewrite rules mentioned there:

The one for categories…
RewriteCond %{QUERY_STRING} cat=38
RewriteRule ^index\.php /blog/category/Doing-business [r=301,nc]

… needs a “?” at the end so…

RewriteCond %{QUERY_STRING} cat=38
RewriteRule ^index\.php /blog/category/Doing-business? [r=301,nc]

Hopefully this is the last time you have to do such a migration.

Peace.

Leave a Comment

Next post: