Jens Krämer

New year, new blog or: Typo upgrade woes

 |  typo, ruby, rails

To give this site some more features (say, tags and typo managed content besides blog articles), I decided it was time to give my old Typo 2.0.6 installation an update.

I intended to migrate my contents step by step and switch over after that, but after upgrading my server to Rails 1.0 the old Typo didn’t run anymore. So here it is, default skin but at least the blog content is converted.

Migrating the database from Typo 2.0.6 to Typo trunk hasn’t been as easy as I thought, because Migrations just don’t work when they use ActiveRecord model classes which are seriously refactored in later revisions. In the case of Typo some unification of pages, articles and comments into one table, contents, was introduced. This broke any Migration created before this step, since the contents table will only be created by a later Migration, but the article, comment and page classes depend on this table.

To work around this, one has to check out each single revision up to the wanted one, running rake migrate everytime. Of course this could be scripted, but nice solutions don’t look like that…

I simply didn’t feel like messing around with the migrations any longer, so I wrote a little script to transfer the contents of my Typo 2.0.6 db into the new Typo’s database.

As everybody seems to be tagging everything these days, it converts existing article categories into tags if you tell it to do so.