The Hell of Categories.

Monday, 10th January, 2005 :: 12:15 - Code, Site

My journal has several scars from changing content management systems over the years.

The first, being the one that most annoys me, is the ridiculously high post ID numbers. This is because blogger used those weird ID numbers, and back when I ran the ‘blogger to b2′ importer those ID numbers were caught, from then on any B2 post ID was up in that insanely high range; that also includes the GM entries I also imported thereafter. I vaguely remember talking to Michel about it and I think he changed the importer script to prevent that. The damage was done for me at least, because by the time I’d talked to Michel about it I had already been using B2 for quite a while.

We did devise a method for correcting it, sort of. The problem was that the post ID was stored not only within the posts table, but also the comment table; fixing it would then disconnect the two. What seems like forever had past and after working on eMotif I learned how to fix the problem.

You might ask why I still have the insanely high post ID numbers, right? The little issues of permalinks, search engines, and all the other problems that radically changing the post ID would bring are the main reasons I never did change it. So, with that being enough of a discouragement, I still have the seemingly random post ID numbers, it’s also a little funny to me, because it appears I have 2.8 million posts.

When I ran all of my uber-complicated MySQL queries to convert my ’specialized’ B2 to WP, I never realized that WP has this post2cat table. I don’t really understand the purpose of it, other than to be annoying, why couldn’t the category field in the post table be sufficient?

I started noticing this really strange category error on the posts that used to be made private in the old b2 style. The error was very vague, but given the entries it appeared on I finally realized it had to do with my conversion. The only way I discovered that I could fix it was to open the post via the edit function and save it again. I realized that running queries on the posts table to change the categories wasn’t working, which didn’t make any sense. I finally, this morning, noticed the post2cat table, it was missing entries for all of those entries showing the error. During the import/conversion/upgrade from B2 to WP those particular entries had a category ID of zero; the conversion process never made entries in the post2cat table for them!

It was with that realization that I knew I’d be having tons and tons of problems with the next part of my little project. No longer could I easily, using MySQL queries, change the category of a post simply by searching the content and using that as a trigger. Obviously it is possible, but the query becomes more difficult because post IDs need to be cross-referenced, the category needs to be updated on a table completely separate. I made a decision that doing things the ‘quick’ way would require far too much time spent learning how to do it; I manually edited all 280 or so entries, opening and then saving them. Yes, it sucked.

Blogger and GM did not support categories, thus all entries were put into ‘Journal’, since it was my number ‘1′ category. This bothered me for quite a while, but changing the categories was such a time-consuming task that it didn’t bother me enough to want to do it. Enter mass category editing, I found the plugin, but using it is so painfully slow that it really isn’t quite worth it. That’s the problem when you have 1500 posts in the same category, that plugin wants to load every single one of them, and for some reason the script doesn’t stop at the number of posts you choose to display if you also choose to display a category; it needs a serious rewrite for usability.

Notice that I said usability. I should be even a bit more precise and say it needs to be more user-friendly. It takes the same query strings that WP itself takes, but this is not overtly clear; once I realized I could feed the month string it became considerably more functional for me. It very well may say that somewhere, I just didn’t notice it.

All of this highlights how critical I am of my writing now. Somewhere along the line, even though I’d always called this my journal, it really did become a journal. I did before that, actually, have a blog. Random and useless garbage was posted on a regular basis, it’s sad. I’m not condemning the format of a blog, contrary to how it appears, I am though recognizing that my style of writing has substantially changed over the years. I am clearly a better writer than I had been. I care much more about the quality of what I’m writing in contrast to the quantity of posts.

Why is all of this important? This journal is an accurate history of my life over the last five years, it is my most valuable document. I’m determined to correct mistakes I’ve made while maintaining it in the past by using the skills I now have.

Comments are closed.