Most people who talk with me about web development for more than five minutes know that I’m a huge fan of Textpattern. It was the first CMS I used, and it wasn’t difficult to love. Everything is clean, logical and it just functions the way I expect it should.

But lately I’ve had my concerns about the direction of Textpattern, and there often comes a time to expand horizons and move on. I’m not convinced that time has come for me just yet, but I will admit that I’ve been playing with Drupal.

This may come as a shock to some of you who know how much of a rocky relationship I’ve had with Drupal in the past. Drupal 6, however, seems really solid and well developed. But like I said, I don’t know that it’s time for me to make a switch just yet. I may turn out to be the 90 year old man still running Textpattern, it’s too early to tell.

All of that aside, when I started working with Drupal I wanted to know that I could bring all of my content from Textpattern over to the new Drupal install. So, in a moment of laziness I wrote a script to take care of everything for me.

All you need to do is specify your information for both databases, point your web browser at the script and let it do its work. Be sure you back everything up because I don’t guarantee that this will not destroy everything you’ve ever created and hold dear. The script will also need to be in a location with access to both databases at the same time, so it may not work as a solution to switch from host to host, for example.

This script will loop through the content of your database’s Textpattern articles and place them into the Drupal equivalent space. All of the articles will be labeled as “pages” unless they’re in the “articles” section of Textpattern, in which case they are created as “stories” in Drupal. If you decided to use a different section as a blog, you can specify that instead of “articles” in the script.

Comments should also be delivered to the correct articles, but it needs to be noted that there could be association issues.

If your Drupal installation has been in use and entries have been removed it is possible that the auto increment values may be off. If that happens the association could be off by one or two, improperly matching the comments and articles. So, if you are having comment alignment issues make sure the auto increment values match. But, if you haven’t been working with the Drupal database this probably isn’t going to be an issue for you.

I stopped with articles and comments because a lot of the setup depends on plugins and preferences. I am, however, open to suggestions as to what else could be included in this script. So, if you have suggestions I’m interested to hear about them. Otherwise, download the script and try it out.