Nov 17

Converting BlogCFC to Wordpress

Posted by James Netherton | Saturday 17 November 2007 2:57 PM | In ColdFusion

I've been experimenting with Wordpress recently and I wanted a way of migrating all of my posts and comments across from BlogCFC. Wordpress does have an RSS import feature which does an Ok job but I wanted to preserve data such as posts that had not been released, comments disabled etc.

There's already a couple of migration tools written by some ColdFusion folks. Unfortunately it looks like the Wordpress database schema has changed significantly since they were written. Therefore, I decided to hack together my own utility.

Some disclaimers before I introduce the tool:

- It'll only run on ColdFusion 8, although it would be easy to alter it to run on other versions.
- It'll only work with MySQL databases.
- I haven't tested it with the latest version of BlogCFC.
- Tested with Wordpress 2.3 only

Here's a small guide to get started......

1. Download the utility from the link below and extract the zip archive somewhere under your web root.

BlogCFCConvert.zip

2. Configure two ColdFusion data sources. One for your BlogCFC database and another for the Wordpress database (assuming you have created the Wordpress database of course).

3. Make some edits to Application.cfm:

- Change request.blogcfcDSN to equal the BlogCFC data source name

- Change request.wpDSN to equal the Wordpress data source name

- You may have installed Wordpress with the option to use a database table prefix. If you did this, set the prefix value in request.wpTablePrefix.

- Set the GMT offset hour value to be applied onto post and comment dates in request.GMTOffset.

- Set request.blogURL to your current BlogCFC root URL. Do not add a trailing '/' character!

- Wordpress lets you define your own URL format which makes it possible to keep all of your old BlogCFC post links in tact for SEO purposes. Uncomment the request.blogURLFormat variable if you wish to do this.

4.Execute index.cfm from wherever you extracted the code to, and the migration process will run. It will display a summary of categories, posts and comments imported when finished.

If everything has gone according to plan you should be able to fire up your Wordpress blog and you'll be presented with all of your BlogCFC posts, categories and comments.

If you chose to uncomment the request.blogURLFormat variable in Application.cfm, browse to the permalinks administration area and set a custom structure of:

/blog/index.cfm/%year%/%monthnum%/%day%/%postname%/

You'll then be able to browse your Wordpress blog using BlogCFC style URL's.

Some remaining tasks might be:

- Migrate across any images and attachments
- Redirect RSS traffic

I've not done a massive amount of testing with this so if there's any bugs or issues, let me know.

 

2 Comments

[Post comment]


1

Posted by Critter | Friday 11 January 2008 11:30 AM

I'll be giving this a look this afternoon. Thanks


2

Posted by doug | Sunday 17 February 2008 10:57 PM

Worked great for me!
discussed the experience here:
http://dougr.net/?p=58

Leave a comment








Captcha text