Tag archives for upgrade

Tuesday, January 23, 2007

One last bit about 2.1

WordPress 2.1 was released yesterday. I won't be upgrading, at least not for a while. If you read my previous bitchfest, you may remember all my problems with the beta version. Every difficulty I was having has since been addressed and the final version is now very solid. But there's still one thing holding me back: plugin compatibility.

In my testing, I'm still having issues with some plugins. To be fair, a lot of those problems are not widespread and may in fact be limited to my very specific set of circumstances. There is one incompatibility, however, that is not limited to me and that's Ultimate Tag Warrior. The current version of UTW does not play well with WP2.1. There's a nasty little bug where a new comment can erase a post's tags.

2.1 does have some excellent new features and I'm disappointed I won't be jumping on that bandwagon just yet, especially after testing it for six months. There's one bright spot in all of this. I don't need to upgrade.

The WP dev team has announced that because of the bump in minimum required MySQL versions (2.1 now requires MySQL 4.0, remember), they won't be abandoning the 2.0.x line. They've committed to maintaining 2.0.x for an additional two to three years. Most webhosts will have some sort of policy requiring you to keep your blog software (and any other scripts you run) updated for security reasons. A vulnerability in your blog software can compromise the integrity of your server and may put other people at risk. Your webhost will be seriously pissed at you if someone exploits a hole in your blog and there are server problems because of it.

The nice thing about the current situation is that I don't have to jump on 2.1 to stay on top of security. In the future we'll see WP 2.0.8 and 2.0.9, etc. (Or maybe 2.0.7.1… I'm not sure how they're going to version that.) I'll upgrade to 2.1 eventually, as soon as my issues are sorted out, but there's no pressure.

You shouldn't feel pressured either. 2.1 is a big deal, and is definitely worth the upgrade, but there are some real gotchas involved. If you can, test 2.1 on a second blog. Like I talked about (at great length) in my previous post, downgrading is a massive chore, so it would be a real kick in the teeth to find problems when it's basically too late to do anything about it. At the very least, be sure to check the (sadly, incomplete) plugin compatibility list to see if your favorites are ready to go.

Sunday, January 14, 2007

I might be a little nuts

Just the other day I was talking about WordPress 2.1 and how excited I was about it. Yeah, I'm not so excited anymore. 2.1 has some nice new features, like new plugin hooks and overhauls to the page and link systems. It also comes along with a handy new feature to export your blog to a WXR-XML file.

The biggest thing I was looking forward to was the fact that 2.1 is essentially a complete rewrite. Nearly all of the code has been rewritten and optimized to be cleaner, faster and more efficient. And it mostly is. Gone are things like the cumbersome, monolithic functions.php. In their place are leaner, more logical files.

The only problem is that 2.1 kind of sucks. Or at least for me, and at least right now. After using development builds of 2.1 on a test blog since July, I was chomping at the bit to get the new version deployed here. So last week I installed WP2.1 beta 2 on this blog. Wow, was that a mistake.

Within a day, I'd found several bugs and plugin incompatibilities. The bugs were mostly pretty minor, but the plugin problems just about killed me. Two plugins I consider absolutely crucial no longer worked worth a damn. Both of these plugins are in active development by very smart people, but 2.1 killed them anyway. Although, to be fair, one of the plugins probably works perfectly and instead the problem was with my own setup. After all, I've been using this blog for a year. That's a lot of plugins running through my database with dirty feet.

But not anymore. If you visited on Friday or part of Saturday, you were probably greeted by a "down for maintenance" message. I was yanking 2.1 out by it's roots so I could go back to a version that did all the things I wanted it to do. Incidentally, reverting like that is not something you're supposed to be able to do. The WordPress team makes upgrades easy as pie, but downgrades? Pfft. Why would you ever want to do that?

I generally agree with the idea of not making any kind of downgrade path. Developers have a general interest in moving their user base forward, not backward. But it sure did make what I wanted to do a big pain in the ass. Sometimes, installing a new version of WP will make changes to the database structure. That's the step that makes downgrades such a pain in the ass. 2.1, with it's radical changes under the hood, is definitely one of those upgrades.

I make database backups regularly (and you do too… right?), so it would have been simple to restore a pre-2.1 backup, delete 2.1 and install an older version. But that wouldn't necessarily fix any database issues that might have been exacerbating the problems I was having with 2.1. I'll probably end up upgrading eventually, so as long as I'm up to elbows now, I might as well clean house on the DB too. So database backups weren't much good to me.

I used the handy new WXR-XML export to download a backup of my blog and then used a plugin to import that XML. But there are a few issues with this. First, the XML export isn't configurable. You get what you get, and what you get kind of sucks. The exporter snags posts, comments and categories. It doesn't export your options, registered users, links, custom plugin tables, etc. That's ten shades of suck.

Second, the XML files are HUGE. When I use Scott Merrill's database backup plugin (the one bundled with WordPress), my download file is about 3MB in size for the entire database. The XML backup, with just three database tables, clocks in at a whopping 13MB. And this is the new feature intended to replace Scott's plugin, which by the way is no longer part of the WP core. WP2.1 does not include wp-db-backup, so if you intend to keep it (and you really should), you'll have to make sure you hang on to your older versions.

Even the parts the XML backup keeps are woefully incomplete. The process of exporting for 2.1 and importing to an older version stripped a lot of things. All of my tags and post layouts were lost. The tags I could do without because one of the troublesome plugins was UTW, but the post layouts? That's a pain.

Sigh. Oh well.

Another pain in the ass is that post and comment ids were lost. I kind of like that the post ids were lost because now my ids are numbered more or less chronologically, rather than the hodge podge I had before. I brought in a lot of archives from previous blogs after this blog was well underway, so I had things like post #548 being ten months older than post #547. And since I use permalinks, this isn't a big deal for me. For the most part, people have no way of knowing which post is #548. However, if I wasn't using permalinks, if I had the default cruft-based structure like /?p=548, all of my links would suddenly point to the wrong posts. This is similar to what happened to my comment ids.

On nearly every theme, including mine, the permalink to any given comment is defined by the comment id. So every link I ever made to a comment needed to be manually repaired. Fortunately, there were only about 40 of them throughout the entire blog. The thing that really kills me about this is that I pointed out this shortcoming to the dev team months ago. I had the misfortune of voicing my concern during the middle of a cat fight and I was essentially ignored.

The export/import process also stripped away all my post slugs. All slugs were automatically regenerated from the post titles. Which, if you're like some, could be a significant problem. I don't tweak post slugs often, but I have retitled posts (like adding "Updated" to signify new content), which breaks the permalinks for those posts.

Anyway, after a lot of grumbling and cursing, I'm back on stable footing again. Through a combination of SQL backups and XML exports, everything is running smoothly and all my data is back in place. Well, most of my data. It'll take ages to tag everything again and replace all my post formatting. But I'd say the effort is worth it if it leaves me with what I really want.
 

100 things about me

7. I'm a little OCD about a few things. My blog is one of them. Those few days I used WP2.1 beta drove me absolutely batty. I felt like my blog was broken, even though it really wasn't. There were some things that didn't work, but possibly I was the only one to notice. All the basic functionality was just fine. Pages loaded without error messages, people could read and comment and the site feed worked fine. That's the essence, the core functionality, of any blog.

But the little things were making me crazy. I knew they were there and I was bitchy and irritable because of it. At least now it's fixed and I'm not freaking out about it anymore.

Another thing I'm a little obsessive about is our DVD library. We've got over 700 DVDs… and they're alphabetized. With each new purchase, I rearrange everything to accommodate the new addition.

So maybe I'm a little crazy. At least now, way down here at the end, you understand the post title.

Wednesday, January 10, 2007

Well alright then

Last night I upgraded this blog to the shiny new WordPress 2.1 beta 2. In addition to finding a couple of plugins no longer working, I found something that's a real kick in the teeth. Remember my sticky posts test from just a few weeks ago? Yeah, that doesn't work in WP2.1. In fact, it fails pretty spectacularly.

Fuckbuckets. Looking on the bright side, at least I never got around to the exhaustive explanation on how to implement it. That would really bring me down. And besides… maybe this is a minor glitch that can still be fixed before 2.1 final ships.

2.1 looks likes it's going to be pretty cool. My favorite enhancements are the ability to have draft and private pages and the Word-style autosave draft function. There's also a pretty substantial overhaul to the bookmark system, including new template tags that make life easier for designer types.

However, the creamy goodness comes with a catch. 2.1 requires a newer version of MySQL than previous versions. 2.0.x and lower require at least 3.23.23, where 2.1 now requires at least 4.0. For those of you unable to hop on the 2.1 bandwagon until your webhost makes some upgrades, the WP dev team has committed to supporting WP 2.0.x for the next several years.

I'm usually not so gung ho about new versions of WP that I'll install a beta on this blog, but 2.1 is pretty cool. And I'm glad I installed it here. I found a bug last night. I always feel pretty cool when I can contribute, rather than just nod my head and say "Yeah, looks pretty good."

Wednesday, June 7, 2006

Notes on hosting your own blog, part 10

So, last week an update to WordPress was released. The new version, 2.0.3, includes a few minor performance enhancements and bug fixes and one big new feature: nonces. Nonces are some moderately complex technobabble that Owen at Asymptomatic does a pretty good job translating into something resembling layman's terms here. The short version is that nonces are a system for verifying that administrative commands come from the right place.

I read the release notes and was very interested in the new version. So I got all of my little ducks lined up in a row and prepared to upgrade. I downloaded the new installation, made an up-to-the minute backup of my database, and FTP'd a copy of my current install to my hard drive.

I've modified the WP core files a bit, so let's just say that I was using WordPress "2.0.2.fish." I took the new 2.0.3 files and added my mods before uploading them to save me the difficulty of doing it after the files were in place.

I activated the Maintenance Mode plugin to take my blog offline and overwrote my current installation with the new version. After the upload, I ran the one-click database upgrade. All finished, I viewed my blog… and found that for some unfathomable reason all of my content was crammed into the sidebar. The content that should have composed the main column was inexplicably displaying with a width of about half a character.

It was completely unusable.

I wondered, "Why would the theme fail in the new WP? Did the Maintenance Mode plugin mess with the install?" So I deleted my WP install and database, restored my backups, disabled Maintenance Mode and tried again.

No luck. Same problem.

I played around with the templates and found that it was only my custom theme that had a problem. The two themes included with WP worked just fine.

I wondered, "So is it a plugin problem?" I disabled all my plugins and tried the whole thing all over again, only to learn that nothing in my custom theme worked without the plugins the theme used.

Eventually, I mucked around with the blog output enough to learn that there was nothing wrong with my theme, or my plugins, or with the WP update.

The problem is that I'm a dumbass.

It was all in those mods I made to the WP core files. See, it turns out that if a file has two modifications, I better damn well make sure I update both of them, not just one. Some of the code I changed involves how the sidebar displays. I was sloppy when I inserted my changes. Garbage in, garbage out.

So in addition to being reminded yet again of how important it is to pay attention and do things right the first time, I also learned a lesson about using plugin template tags.

Trying to troubleshoot plugins without being able to disable the plugins was a colossal pain in the ass. So I took the time to sort out my template and wrap all plugin calls with function checks. I'm now at a point where I can disable all my plugins and everything will still work. Which is exactly what I need for troubleshooting in the future.

Confused about that function check business? It's simple, yet kind of important, so I'll explain.

The install instructions for a plugin with template features may tell you to insert a line of code like this:

<?php plugin_function('do_something_cool'); ?>

I would strongly recommend you wrap that in a function check, like this:

<?php if (function_exists('plugin_function')) { plugin_function('do_something_cool'); } ?>

The first line of code basically says "do this or else." The second line of code is more like "if you can do this, then do. Otherwise don't worry about it." And that's exactly what one needs to disable a plugin without also removing any matching template tags.
 

It's a good thing that I finally got around to adding those function check wrappers, but it turns out that the whole thing was kind of an exercise in foolishness. Although the new nonce system is cool, WordPress 2.0.3 is no kind of improvement at all. Those nonces don't really work right.

For some reason or another, every edit or delete operation I perform generates an extra warning prompt. And everything I edit suddenly has all single and double quotes escaped. (Like this: \"Let\'s go to John\'s house.\") What a pain in the ass.

Apparently these problems are not unique to me. There's a support thread on the WordPress site where people are talking about it. Mark Jaquith has even developed a plugin to fix it.

But that's a little messed up. Install the new update and then install a third party plugin to get the update to work? That blows. I'd recommend skipping WP 2.0.3 altogether and just waiting for the next revision.

Monday, March 13, 2006

Notes on hosting your own blog, part 7

Just a few days ago, the fine folks at WordPress.org released WordPress 2.0.2. From the inception of this blog's current form I've been using 2.0.1, so this is my first upgrade. The directions in the codex are simple to follow and worked flawlessly. It was just delete this, that and the other thing, upload new files and I was done.

The directions remind you to backup your language packs if you're using WP in a language other than English, but they miss one vital thing. You should also backup your .htaccess file. Failing to do so will change things like the permalink structure and will break addons like Ordered List's Feedburner plugin.

Fortunately I thought ahead and made a backup of everything. The upgrade from 2.0.1 to 2.0.2 was painless and quick, but only because I took that extra step they didn't bother to mention.