Converting a TextPattern site to WordPress

I decided to move the old website from TextPattern to WordPress. I was getting tired of the TXP interface and lack of plugins (in comparison), and was waiting for what seemed like years for TXP 5 to arrive. However, the wait has ended, and I am giving WordPress a shot. Converting from TextPattern to WordPress was not as bad as I expected, but it did take some effort.

In case you are thinking about doing the same thing, here is a brief outline of the conversion.

I started with the TextPattern Importer plugin. It converts your database tables and all that goodness – pretty much like any of the other import tools baked into WordPress. Simple enough to use – just activate the plugin, and navigate to the Tools/Import menu and select ‘TextPattern’.

I ended up doing a little clean up of my new WordPress database after the import. I needed to clear out all the post_excerpt entries in the ‘wp_posts’ table. I did this because when testing out the post editor, I was pulling out my hair trying to figure out why the ‘excerpt’ for any given article was not updating. Apparently, the handy <!-- more --> tag does not do anything to your posts if you have an excerpt associated with it in the DB. And…. there is no way to edit the excerpt via WordPress, unless I am missing something, which frankly is very likely. Anyway:

UPDATE wp_posts SET wp_posts.post_excerpt = "";

fixed the issue for me.

Next, I needed to address the Textile syntax I leaned heavily on with TXP. Let me say Textile is great. It was a requirement for me to switch over to WordPress. Textile 2 plugin to the rescue. I would link to it, but the link for the plugin results in a 404… hrmmm, at least the plugin works!

With the initial database import/cleanup done and Textile installed, I decided to convert my SWF embeds next. With TXP, I used the great swf-embedding-plugin ,wlk_flem. I like this plugin because it allows you to substitute your SWF embeds with poster images, that will hide and activate the SWF once clicked. Since I have a lot of Flash experiments that can run heavy on the CPU, its great to not invoke said SWFS until they are explicitly told to do so. This was the biggest hurdle in my conversion… there aren’t any SWF embedding plugins for WordPress that do this…. must be TIME TO HACK!

I started with the SWFObj plugin, and hacked it up to support setting a poster image just like the wlk_flem plugin. Since I suck at social coding (I just got a GitHub account), I have no idea how to fork this plugin and submit it. Perhaps I’ll just send my version to the original author and see if he wants to use it.

With the SWFs out of the way, it was easy to see my media files and downloadable files links were busted. Basically, anything using the TXP tags to reference links/files did not get converted on the initial import. To fix this, I ended up exporting my working WordPress database to an SQL file, and using TextMate to run some find/replace queries with RegEx to fix these busted links.

Lastly, I needed to make sure my old permalinks links would work. A broken permalink is bad news when rolling out an ‘upgrade’. That was really easy to do with by setting a Custom Structure in the Settings/Permalinks page in the WordPress console.

That was pretty much it. Overall, it took me a month or so of just poking around at it when I got bored; changing some styling rules as I saw fit. I was in no rush to convert, but I am pretty happy with the WordPress admin and templates so far. Although, I do think WordPress runs slower than TXP. Maybe it’s just my theme, but it’s something I will be keeping an eye on.

If you are gearing up to convert your TextPattern site to WordPress, good luck! It’s not too hard, but there are a lot of gotchas to be aware of before you set your new site live. Cheers.

One Response to 'Converting a TextPattern site to WordPress'

  1. mattc says:

    I’d love to see what you’ve done with the SwfObj plugin. Showing a poster image by default sounds like a fantastic idea. Please shoot me an email if you get a chance, I’m definitely interested in folding your hacks into the next plugin release.

    Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

*