HiI'mJaanus.Blog,Works.

Upgrading to Movable Type 3.3: smooth schema update, Tags plugin fix, broken styles

I just upgraded this blog from Movable Type 3.20 to 3.32.

The overall upgrade experience was smooth. You drop the files either over your current installation or in a new directory and go to the backend login. MT automatically detects an older database and offers to upgrade. It does the database schema updates (a few new tables, and a few columns added to old tables), adds some pieces of new data, and even tries to migrate over all your tags that you use previously with some plugin. (Tags are now a native feature.) Alas, the last bit is unsuccessful, see below in “tags migration”. Apart from the tags problem and styles fuckups, the migration works fine.

The plugins Markdown, SmartyPants and Compare also work fine for me. Removed the Tags plugin since it’s no longer needed.

Things to read before doing your own migration…

New features

Why upgrade in the first place? There’s a LOT of new stuff in MT3.3: some major, some minor. Many improvements are immediately obvious. Here are the ones I’ve encountered.

Tags. Finally a native feature instead of some obscure plugin. Tags and keywords are now two independent fields. Previously, there were plugins available that somehow tweaked the Keywords behaviour so that keywords were used as tags but actually converted to special Categories, which caused havoc if you also enterd some actual category in the keywords field.

The tags field works fine and does “typedown hints”: as soon as you type a letter, it displays all tags beginning with that letter, letting you to choose from them. A bit uncool compared to the plugin is that you can’t see the full list of your tags.

There are now template tags to help you build weighted tag clouds. You could previously do this with all sorts of obscure PHP hacks, but now it’s inline. Cool. What’s not so cool, though, is that they have ranks from 1 to 6, and offer to build the tag clouds with the <h1> to <h6> tags. Ummm… no. The semantics of <h1> to <h6> are to denote headings of various weight, not to build some formatted clouds. So the proper way to do this is to have some styles named, say “tagweight1” to “tagweight6” in your stylesheet, and format them properly, not do it with the heading tags.

New default setting for how many entries to display on front page. It used to be “7 days”, but is now “10 entries”. This was the first thing I always changed on a new blog. Good to know the default is OK now.

New setting: default editor display options. This lets you configure default settings for which fields are displayed in a given blog. This is a great way of pre-configuring your blog to novice authors who need to, say, edit the tags but not mess with entry basenames.

“Select current blog” dropdown automatically goes to the right blog. Previously you had to select the blog and click “go”. The wrong blog may have been selected in the dropdown, and if you were, say, editing the templates across blog in multiple languages, this may have caused total havoc. Fixed now: the new behaviour makes sure the dropdown always indicates which blog you’re actually working with.

Search template is now a normal template now, you can edit it per-blog in the blog backend instead of having to go to filesystem. Finally. The anomaly is fixed. I never understood why it had to be an outside file in the first place. And the difference is pretty big for organizations where anyone can’t just go to the live server and mess with files and you have to do a “code release” whenever files change — but you can edit the blog backend. So thanks. And it used to be one template per installation and you had to go to configuration to edit the blog<>template mappings, but now it’s a normal per-blog template like all the others.

Bugs

The new config file is minimal. If you got a heavily configured blog, may want to copy-paste a lot of old values over. The file has a link to here, but this does only a search on SixApart site and is thus a bit useless. It should redirect to config reference.

[resolved?] Messed up styles

A visible indication of the upgrade on this blog, if you’re not reading with RSS, is that I’ve switched back to a default style. That’s because other styles downloaded with the default StyleCatcher plugin simply appear to be broken for me in MT3.3 and Firefox. To test, I did a fresh new blog in in MT3.3, didn’t touch any of the templates or stylesheets, switched the style to another one in StyleCatcher and BOOM, broken layout. Maybe the styles in the MT Style Library are not yet MT3.3-compatible or something… in any case, beware with the styles.

UPDATE: of course, the darndest thing happened. I re-tried updating the styles today and of course they are all fine, not badly positioned like yesterday… so not sure what that was about.

Tags from the Tags plugin messed up and how to fix them

I was using the Tags plugin previously. It sort of worked fine but sometimes grokked when the author wasn’t too careful about Categories and Tags. It converted keywords to special categories and added a few tags.

The object models of the Tags plugin and MT3.3 tags feature are different. The plugin keeps the tags as categories and the tag<>entry associations as simple text in the Keywords field. MT3.3 has a full many-to-many relation object model. So you need to convert the keywords to tags “properly”. Which the upgrader tries to do for you, but fails miserably, at least in my case. When the tags were previously, say, “tag1, tag2, tag3”, the converter ends up with “1, tag3”. I’m not sure what’s with the figure, but it didn’t work.

So… if something doesn’t work, fix it. I wrote a script for myself that pulls the tags used by the Tags plugin and converts them into new MT3.3-style tags properly. There are a couple of assumptions…

  • it converts all keywords of your entries into tags.
  • it expects the MT3.3 database schema to be already there (so you need to have already upgraded to MT3.3).
  • your tags/keywords shouldn’t have any spaces in them. If they have, they will probably be converted into multiple tags (didn’t try this myself, I don’t have any spaces in tags). (UPDATE 20070612: new version should be OK with spaces, see below)
  • if an entry doesn’t have keywords/tags, it’s not touched.
  • if you have already entered any tags in MT3.3 for an entry that has keywords, those will be wiped out and replaced with the tags from keywords.
  • you know how to edit the parameters and can run this script with Perl.

Use at your own risk. Download here.

UPDATE 20070612: thanks Andrew who contributed the fix that should make it work fine with tags that have spaces in them as well.

Discuss this whole thing in the Six Apart forum

Next up

One other thing I want to do is to get proper spam comment/trackback junking. It’s cool that you can junk stuff with the Junk button, but it doesn’t seem to be a “learning” filter, unlike, say, Thunderbird’s e-mail filter. People are praising Akismet and it also has some Movable Type plugins, although there are comments that it’s not working with MT3.3.

Comments