MT 3.3.1 tags upgrade
With No Comments »
Had a spare moment so installed MT 3.3.. Seems fine overall, actually, i haven’t done much with it yet, not even sure what the new features are.
Apart from it now has proper tag support but I knew I would have issues with the old tags plugin I used before. Signs looked great at first, the upgrade routine converted my tags to the new system. But it didn’t half make a naff effort, all sorts of weird things went on. And weirdest all my entries were given the tag “0″ or “1″ or even “2″. Lucky them huh?
So, if like my you used to use the Tags.pl plugin by some fool called Brad Choate, I think that was the one, I’ve already deleted it lol. I’ve written some SQL to do a proper upgrade of the tags. The SQL is pretty easy and straight forward so I dunno why MT couldn’t do it.
So, go into phpMyAdmin or simiular, select the database and click on the SQL tab to execute stuff. Oh actually, before you do that, look inside the table “mt_category” and see if its full of categories with “<!–tag–>” as the description. If there is you have been using the same plugin, so go on and do the following…
Stage 1: BACKUP THE DATABASE
Stage 2: First 2 Operations are quite dangerous so be careful c+ping. These will completely delete all of the new tagging data that the upgrade procedure made, and any you’ve created since upgrading to 3.3.x. Oh, on all blogs as well.
DELETE FROM mt_objecttag;
DELETE FROM mt_tag;
Stage 3: Now to copy the tag names
INSERT INTO mt_tag (tag_name)
SELECT category_label FROM mt_category
WHERE category_description = “<!–tag–>”;
Stage 4: Now to pair the tags with the entries
INSERT INTO mt_objecttag (objecttag_blog_id, objecttag_object_datasource, objecttag_object_id, objecttag_tag_id)
SELECT placement_blog_id, “entry”, placement_entry_id, tag_id FROM mt_tag, mt_placement, mt_category
WHERE placement_category_id = category_id
AND tag_name = category_label;
Stage 5: Important, to finish we clean up (delete) all the old style tagging from the old tags plugin. Before you do this its probably best to check that the above actually worked.
DELETE mt_placement FROM mt_placement, mt_category
WHERE placement_category_id = category_id
AND category_description = “<!–tag–>”;
DELETE FROM mt_category
WHERE category_description = “<!–tag–>”;
All done. You know what though? I’m not actually sure what advantages the new tagging system offers, or how its going to work with ecto… if at all ![]()
Been playing some more with my tag code of wonder. It’s now more scalable and customisable. Plus it seems to work on IE now.