Who we are.

Who we are

if by design is a web design and development agency based in the Midlands, UK.

Don't forget to visit our website.

How to find what you want

How to find what you want

Our blog contains articles with hints, how-tos and other thoughts. To help you find what you want they have been organised into categories:

 

Automatic migration from typo to WordPress

Here are two scripts that should help anyone migrating from typo (Ruby on Rails blogging platform) to WordPress. The scripts will import articles, pages, comments, categories and tags through a sequence of SQL queries that map fields from typo to their equivalent in WordPress. Simple, quick and beats importing via RSS.

You can download the scripts here: typo_to_wordpress.zip.

Update - 11 Jul 2006: The scripts were updated to incorporate Case Larsen’s comments. Many thanks to him.

The zip file contains two scripts, one with tag support and one without. The script has been tested with typo 2.6.0, WordPress 2.0.3 and Ultimate Tag Warrior 3.1.
Both scripts:

  • Remove the example posts, pages and comments from WordPress (including cleaning up the category associations and category post counts).
  • Import all the categories from typo into WordPress
  • Import all the articles from typo into WordPress (including setting the publish, comment and ping status)
  • Import all the pages from typo into WordPress
  • Import all the comments from typo into WordPress
  • Create all the associations between posts and categories
  • Link each comment to its post
  • Update the permalink structure for posts and categories to match typo
  • Update each category with the correct post count.
  • Update each post with the correct comment count.
  • Remove the old typo tables

The second script (typo_to_wordpress_with_utw.sql) with Ultimate Tag Warrior (UTW) support also:

  • Imports all the active tags from typo into WordPress
  • Creates all the associations between tags and posts
  • Updates the permalink for tags
  • Turns on pretty URLs for tags

Assumptions:

  • All times in typo are UTC and the WordPress local timezone is UTC.
  • The author of all the posts and pages will be the WordPress admin user
  • The permalink structure for posts in typo is: ‘/articles/%year%/%monthnum%/%day%/%postname%/’ (default)
  • The permalink structure for categories in typo is: ‘/articles/category/%category_name%’ (default)
  • You have just installed a fresh copy of WordPress

Step-by-step guide to the standard script:

  1. Export the articles_categories, categories and contents tables from the typo database.
  2. Install a fresh copy of WordPress.
  3. Import the typo export from step 1 into the WordPress database.
  4. Run the typo_to_wordpress.sql update script.

Step-by-step guide to the script with UTW support

  1. Export the articles_tags, tags, articles_categories, categories and contents tables from the typo database.
  2. Install a fresh copy of WordPress.
  3. Install the UTW plugin
  4. Active the UTW plugin
  5. Import the typo export from step 1 into the WordPress database.
  6. Run the typo_to_wordpress_with_utw.sql update script.

Finally, it is worth adding the following lines to your .htaccess to maintain the permalinks for your pages and RSS feeds, the line should go directly beneath the ‘RewriteBase /’ line

RewriteRule ^pages/(.*)$ /$1 [R=301,L]
RewriteRule ^xml/rss/feed\.xml$ /feed/ [R=301,L]

If you have used the script with UTW support also add the following line to perserve the permalinks for tags

RewriteRule ^articles/tag/(.*)$ /tags/$1 [R=301,L]

That’s it.

Feel free to comment on the script and suggestion improvements. If you have any problems let me know and I’ll be happy to help.

 
  1. Do you think this could be turned into an importer we could bundle with WordPress?

    Matt said on 27 June 2006 at 2:59 am
  2. Good thinking, I’ll have a look into it tonight and hopefully get a proper importer uploaded asap.

    Stuart Johnston said on 27 June 2006 at 12:14 pm
  3. […] From: ctrclick by Stuart Johnson Here are two scripts that should help anyone migrating from typo (Ruby on Rails blogging platform) to WordPress. The scripts will import articles, pages, comments, categories and tags through a sequence of SQL queries that map fields from typo to their equivalent in WordPress. Simple, quick and beats importing via RSS. […]

    scriptalicio.us» Blog Archive » Automatic migration from Typo to WordPress said on 28 June 2006 at 10:38 pm
  4. Actually, I was hoping to get it going the other way around. The current importer that comes with the latest branch of Typo only imports from the 1.5 version of Wordpress. I need it working for 2.0x WP to typo.

    OK, yes, I should probably just stop being lazy and use what you’ve got to hack it backwards myself… ;-)
    Sure I can’t convince you to do it for me ? Really, I’m swamped…

    Daryl said on 6 July 2006 at 9:19 am
  5. Why, not - I’ll add it to my list of things to do and we’ll see who gets there first :-)

    Stuart Johnston said on 6 July 2006 at 9:32 am
  6. Ya…I would guess that most people wouldn’t want to downgrade to Wordpress…

    Hank said on 6 July 2006 at 10:50 am
  7. some of the typo installations have two body and extended fields:
    body and body_html, extended and extended_html

    when one is empty or NULL, the other is populated. Also, concat involving NULL parameters results in NULL, so you have to convert those to empty strings.

    So you have to change the select expression for building the content body for importing to:
    concat(CASE body_html WHEN ” then IFNULL(body,”) ELSE IFNULL(body_html,”) END,
    CASE extended_html WHEN ” then IFNULL(extended,”)
    ELSE
    IFNULL(extended_html,”) END)

    something similar would need to be done for the comments too, but for my situation, didn’t have too many comments to deal with.

    Case Larsen said on 9 July 2006 at 3:20 am
  8. Actually, I wouldn’t call a move to Wordpress a downgrade. Typo is very cool but let’s face it, WP is probably the leading blogging software out there. Easy to install, relatively painless and has an excellent collection of plugins.

    I’m just moving over to Typo (even though even the admins at TextDrive think it’s a memory hog) because I’m working hard on my Rails expertise and considering how much of php I learned from using Wordpress, hope to dupe the feat on Typo.

    Out of curiosity though, I keep hearing a lot of complaints about how bloated Typo has become. Is there another feature rich alternative in the Rails space ?

    Daryl said on 10 July 2006 at 2:05 am
  9. Case: Cheers for the suggestion, I’ve updated the scripts accordingly.

    Daryl: Still working on the WordPress-to-typo script. Just needs a little tweaking and I’m there.

    Totally agree with you on typo v. WordPress. I’m a big Rails fan so it annoyed me having to move to a PHP based system but I’ve really enjoyed WordPress and its been a good introduction to PHP. I’ve just rolled it out as the main tool for our corporate blogs. It definitely has the edge on plugins, stability and ease of installation.

    Stuart Johnston said on 11 July 2006 at 11:22 pm
  10. Cool. Looking forward to seeing the finished script. Been playing with Typo on my textdrive account and like it a great deal though wordpress still seems to have the edge for me in a lot of things and their plugins are practically exhaustive for anything you can think of.

    Daryl said on 14 July 2006 at 7:33 am
  11. Is this script only compatible with the current (svn) Typo version? The latest stable Typo release doesn’t have a “contents” database table, but the svn version has.

    Niek said on 21 July 2006 at 9:15 am
  12. I don’t suppose anyone has tried using this with Typo 4.0.x?

    FWIW, migrating from Typo to WP is definitely not a downgrade. WP has caught up with a lot of the Ajax tricks that made Typo so cool to start off with, and combined with Typo’s own shortcomings (stability and scalability, spam control, lack of themes, evolution away from the ‘lean, mean, blogging engine’ theme), it has many bloggers wondering if Typo is for them. The guys working on Typo are great, but the core developer community is small, and it just doesn’t feel like production-ready software yet. (Much more to say, possibly on my own blog at some point.)

    Uzair said on 21 August 2006 at 12:44 am
  13. […] Mad props to this guy. His SQL saved me a good deal of time. […]

    CactusWax.net » Back to wordpress… said on 23 August 2006 at 7:54 am
  14. I got it to work with typo 4.0.2.
    I had to modify the sql file a bit, and modify the sql dump from my typo database (just the create table statements).

    eliott said on 25 August 2006 at 11:18 pm
  15. Thank you very much, my blog is now moved back to WordPress. Now… too bad themes don’t convert so easily!!

    Eliot said on 11 September 2006 at 11:17 pm
  16. […] Well, my 1-year experiment with Typo is over. It wasn’t all bad, but eventually I got fed up of having to babysit my blog. And in the meantime, Wordpress caught up with the only real functional advantages of Typo (AJAX integration). The migration has been fairly smooth thus far, thanks to SQL from Stuart Johnston and Eliott. There are still a few things that need to be done: * Markdown syntax isn’t working. This isn’t a huge deal (although I do like Markdown since I post from several diferent bits of software, not all of which offer the same keyboard shortcuts), but old articles don’t display very well because I’ve used it in them. Interestingly, this does highlight the point that Markdown syntax is easy on the eyes and makes sense even if displayed as plain text. * Hemingway woes. There are several serious problems with Hemingway, in my humble opinion. First, the number of articles to be displayed on the first page is hard-coded to 2. The PHP behind the scenes is simple enough that changing this and getting the additional posts to render correctly is trivial, but it’d be nice if it wasn’t hard-coded in the first place. Unfortunately, getting articles to line up correctly when showing more than 2 is a massive pain (I’ve talked about this before), especially when images are embedded in the post. I’m not sure what the answer is. Update: I think I’m going to get rid of Hemingway…it’s just not working out right now. Especially if I want to keep putting up pictures… I gotta say, I’m getting waaay more spam than I used to with Typo. I think that’s because the default ping server list in Wordpress is pretty long. The SpamKarma plugin’s doing pretty well in weeding the crap comments out though. In other news, I’m using the new Windows Live Writer blog client’s Beta version. Its one of Microsoft’s new suite of Live products, and its quite nice. One of my projects for this trip was to hack on Tanjunka to get it to the point where I could sanely use it to post without having to fudge published dates, or wrestle with inserting images. Thankfully, Live Writer makes that unnecessary. It’s a fairly nice product that lets you do all the things you’d expect to want to do: drag/drop images, post with a WYSIWYG editor, post with raw HTML, etc. It does some cool things like look at your blog’s styles so that you can post in the same font that your blog will display it as. And, AND, it lets you post a thumbnail to your blog and link to the full version; uploading both is taken care of automatically. Seriously, this is such a major step forward in as far as free blog editors are concerned, that my heart is swelling with gratitude for MS right now. There are some shortcomings: * There’s no way to get the WYSIWYG editor to produce Markdown syntax or any other non-HTML markup. This means the WYSIWYG edior, with its pretty font, is useless. * The (Beta version at least) only has one level of undo/redo. Assuming Microsoft’s using one of their basic editor controls for the editors, I expect this to be fixed before the final version is released. * Saving your raw-HTML post and then reloading it makes Live Writer insert crappy HTML in it. […]

    Proportioned Pontification » Blog Archive » Quick Hits, post-Wordpress migration said on 23 September 2006 at 6:28 pm
  17. […] Since there is no official migration path for a typo to wordpress migration, I used Stuart Johnston’s and Eliott’s changes to Stuart’s .sql-scripts (see the 2nd comment) and it worked flawlessly. […]

    Switch from Typo to Wordpress at Starting up another Start-Up for Starters said on 23 October 2006 at 11:53 am
  18. […] So for the time being, I’ve converted to WordPress. Stuart Johnson’s conversion scripts helped me move from Typo to WordPress. If you use them, keep in mind that they were made for Typo 2.x. If you try to migrate a Typo 4.x setup, you’ll have to rename Typo’s “categorizations” table to “articles_categories” and do some fiddling with the post and comment counters. […]

    Emergency escape from planet Typo | Technophile Monkey said on 26 November 2006 at 11:55 am
  19. […] So for the time being, I’ve converted to WordPress. Stuart Johnston’s conversion scripts helped me move from Typo to WordPress. If you use them, keep in mind that they were made for Typo 2.x. If you try to migrate a Typo 4.x setup, you’ll have to rename Typo’s “categorizations” table to “articles_categories” and do some fiddling with the post and comment counters. […]

    Technophile Monkey » Emergency escape from planet Typo said on 26 November 2006 at 12:13 pm
  20. I have to say thank you in the name of a friend of mine, as i moved her blog now after finding this site.

    Jermaine said on 18 December 2006 at 12:38 am
  21. […] Stuart Johnson has a Typo to Wordpress migration script that almost worked for me. I had a problem with the post content not showing up. I simplified the SQL for this step, as I didn’t have the pre-generated HTML or the extended pieces. I just copied the existing content field directly over to Wordpress. […]

    Migrate your Typo blog to Wordpress » CRAZ8 said on 12 January 2007 at 5:41 am
  22. How’s the finalizing of the update?

    Andy C. said on 19 January 2007 at 4:27 am
  23. […] I like trying out new stuff. That’s why I chose Typo as my blog engine. It’s Ruby on Rails, has fancy themes and is all Ajaxed up. Well, I learned my lesson again. I’ve been using Typo for almost half a year and ended up spending several hours every month fixing it. At first I thought it’s a good opportunity to get familiar with Rails. But it keeps getting worse. Every upgrade broke the theme I was using. Sometime I got Rails application error accessing the home page. Just when I thought the situation will be better as more people start using it, I found out everybody is moving to Mephisto which is yet another Rails based blog engine. Finally my Typo installation was FUBARed a couple of days ago. This time I didn’t even do anything. No upgrade or whatsoever. It’s just DEAD! After a chat with Jeff, I decided that I have better things to do than babysitting my blog. So here it is. Simonlin.ca is powered by WordPress now. It took me about an hour to move the whole thing over while sitting on the couch watching TV thank to the script from Stuart. […]

    From Journeyman to Master » Archives » Typo to WordPress said on 3 February 2007 at 12:44 am
  24. Your article is very informative and helped me further.

    Thanks, David

    davidvogt said on 3 February 2007 at 4:10 pm
  25. Hello, my name is Alex, i’m a newbie here. I really do like your resource and really interested in things you discuss here, also would like to enter your community, hope it is possible:-) Cya around, best regards, Alex!

    Alexbiipb said on 11 February 2007 at 1:48 am
  26. Hallo!
    I posted a message here to say ‘Thank you’ for the website.
    It greatly made a deep impression on me
    Dont forget your users!

    Sincerely,

    me ;)
    __________
    http://99-luft-balloons.biz01.info

    tloeyblyadi said on 20 February 2007 at 3:44 pm
  27. I just wanted to say that this article has proved to be a very interesting read, even for a newbie like me

    Thanks for posting

    Alison said on 22 February 2007 at 1:07 pm
  28. Following the above, the script seems to do the conversion nicely for Typo to Wordpress without a hitch.

    I can get to the site as http://www.shokk.com/wordpress/ just fine.
    However, when I try to go to the permalink that’s been set up, I get a notice that the path does not exist. What do I need to change to make these paths work:

    http://www.shokk.com/wordpress/articles/2007/01/30/google-pagerank-pepper-for-mint-prank/

    Ernie Oporto said on 22 February 2007 at 6:55 pm
  29. Nevermind. Found the setting under Options. All works nicely. Thanks!

    Ernie Oporto said on 22 February 2007 at 7:17 pm
  30. Thanks for taking the time to post this. At the moment i’m searching through the internet to find as many tips and tricks as i can before integrating a blog into my site and this one should prove useful. Thanks again!

    Herb said on 5 March 2007 at 11:47 am
  31. Good site! I found in google.com +

    Sandy said on 14 March 2007 at 5:20 pm
  32. Hi,

    I’m running Typo 2.6.0 and I don’t have a contents table! This is an install on Site5 hosting using their Typo installer. What does the script garner from the contents table?

    Bruce

    Bruce Boughton said on 24 March 2007 at 12:29 am
  33. […] Just to have it at hand when that day comes: Automatic migration from typo to Wordpress […]

    Typo sentenced to death at Koke’s said on 24 March 2007 at 12:48 pm
  34. Hi, I’d just like to say that I found this article very informative and that it will prove very useful to me. Thanks alot for taking the time to post this.

    hip said on 26 March 2007 at 9:14 am
  35. Very interesting article, it certainly helped me make sense of a few things

    Sarah said on 25 April 2007 at 11:19 am
  36. Peace people

    We love you

    HelloWorld said on 28 April 2007 at 12:47 pm
  37. Thank you for contributing this to all of us.
    Especially the part about .htaccess to maintain all permalinks for the pages was worth trying. i hate mod_rewrite ;-)

    Michelle said on 19 June 2007 at 12:19 am
  38. Great article explained in plain English and easy to follow - Fantastic.

    Linda said on 22 June 2007 at 5:24 pm
  39. […] Maintaining typo just became too time consuming and painful so I have moved back to Wordpress thanks to the migration scripts from Stuart Johnston. Some changes were needed and my tags and comments have not migrated but will look at them later. In the meantime I am back in blogland! […]

    Zaheer Abbas Merali » Blog Archive » Finally got round to fixing my blog said on 23 June 2007 at 5:01 pm
  40. Thanks very much — this was quite useful. I have posted a modified version of the script at http://www.thirdbit.net/articles/2007/06/25/typo-to-wordpress-migration/ — the Typo schema is different from what is addressed in your script.

    Max Newell said on 26 June 2007 at 4:42 am
  41. Very interesting, explained really well. Thank you.

    Girly said on 1 August 2007 at 8:57 pm
  42. I actually have an upstream question– we’re trying to decide if a conversion makes sense. Anyone have a good analysis of Typo vs. Wordpress?

    Bryan said on 8 August 2007 at 5:18 pm
  43. switching from Typo to Wordpress cant be a downgrade! Worldpress IS the no.1 blogging software these day’s surely?.

    apartment said on 12 August 2007 at 5:37 pm
  44. […] Thanks to Stuart Johnson’s migration scripts i have been able to migrate all posts and categories across to WordPress. I have also implemented the URL rewrites for the old RSS feeds, so they should continue to work. The only difference is we won’t get that annoying comma in the URL which broke everything on Typo! […]

    MyChores Journal » Blog Archive » MyChores Journal now on WordPress said on 19 August 2007 at 12:11 am
  45. […] I migrated the MyChores journal across to WordPress! I found some excellent scripts to perform the migration (not everything worked since the Typo journal was horribly out of date!) so i have all the posts and categories as before, plus there was some dark magic involved to keep the old permalink format and redirect the old RSS URLs to the new ones, meaning that the feeds should still work. […]

    Aimee’s escape from LiveJournal » Blog Archive » I did it! said on 19 August 2007 at 12:52 pm
  46. Hmmm i have been wanting to move to wordpress for a while and thought i would have to start all over again!

    I didn’t realise i could migrate my articles!!! - This is great! :-) thankyou for this post!!! - Keep up the good work… sharing information is what the net is for and you are doing a great job !!!

    spanish said on 24 August 2007 at 6:56 pm
  47. Daryl: mephisto is a good typo alternative

    Jarrod said on 28 September 2007 at 5:54 pm
  48. @Jarrod: it’s unproven and has even worse memory requirements.

    The wordpress codebase is a mess due to the language it’s written in, but it has enough committers who understand it to make it robust.
    Typo seems to have been abandoned by its original authors and the code became much more complicated in recent releases.

    Dick Davies said on 7 October 2007 at 11:24 pm
  49. You are number one on Google for the term - typo to wordpress - and so you should be. Excellent article - I still haven’t got the bottle to move myself, but one day I’ll make the move. Your article moved me one step closer!

    Jenny said on 11 October 2007 at 5:13 pm
  50. bruce campbell actor…

    I Googled for something completely different, but found your page…and have to say thanks. nice read….

    bruce campbell actor said on 5 February 2008 at 12:10 pm
  51. […] With thanks to ifbydesign.com. […]

    MyChores Journal » Blog Archive » MyChores Journal RSS feed said on 13 April 2008 at 8:46 am
  52. I was trying to use this script or at least take it as reference, but doesn’t seem to be any related to typo3 4.1.5 at all :( None of the stated tables do exist anymore. Either typo3 has dramatically changed its datbase structure or I don’t know what I’m doing at all.

    Any help? Advice?

    dave said on 7 February 2009 at 3:42 pm
  53. […] version 4.1.1 which requires Rails 1.2.6. So a change is imminent and I found a couple resources by Stuart Johnston and Max […]

    Moving from Typo to Wordpress @ Raymond Law said on 23 February 2009 at 12:04 pm
  54. […] if by design » Blog Archive » Automatic migration from typo to … […]

    Google Maps, Buscador de Numeros Celulares said on 21 March 2009 at 10:27 pm
  55. […] if by design Blog Archive Automatic migration from typo to Posted by root 1 hour 41 minutes ago (http://blog.ifbydesign.com) Feel free to comment on the script and suggestion improvements simonlin ca is powered by wordpress now it took me about an hour to move the whole thing over while sitting on the couch watching tv thank to the script from stuart Discuss  |  Bury |  News | if by design Blog Archive Automatic migration from typo to […]

    if by design Blog Archive Automatic migration from typo to | Wood TV Stand said on 1 June 2009 at 12:19 am
  56. […] if by design Blog Archive Automatic migration from typo to Posted by root 19 minutes ago (http://blog.ifbydesign.com) Feel free to comment on the script and suggestion improvements that my heart is swelling with gratitude for ms right now simonlin ca is powered by wordpress now it took me about an hour to move the whole thing over while Discuss  |  Bury |  News | if by design Blog Archive Automatic migration from typo to […]

    if by design Blog Archive Automatic migration from typo to | Joint Pain Relief said on 8 June 2009 at 7:36 pm
  57. to dave: typo3 and typo are not the same software.

    to all: i thought this script was integrated with wordpress? I wish to convert all of my ruby-typo stuff to wordpress or blogger.

    somekool said on 13 June 2009 at 1:00 am

Please add your comments...


We hate spam. Your email address will not
be published, sold or leased to anyone.


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>