WordPress Upgrade Today
28 Jan 2007
My web host, DreamHost, offers a really great one-click install feature through its control panel. Using it, you can install the latest version of WordPress ridiculously easily. Even better, you can upgrade any WordPress install with a simple click… as long as that WordPress installation was installed using the one-click install system.
So here’s my problem. I have recognized the awesomeness of the one-click install/upgrade system, but if I want to take advantage of it, I have no choice but to export my entire blog — entries, comments, theme, plugins, modifications and all — and then re-import them all on a fresh one-click WordPress install. I’m doing this today. I think it will be worth it.
Anyway, if there’s any down time, you know why.
UPDATE 1: I have exported my WordPress database files, which is why I disabled commenting. (Sorry if you tried to leave a comment and lost it; deleting the
wp-post-comments.php file was the quickest and easiest way to prevent new comments from being posted which wouldn’t make the transfer.) I’m running into other unforeseen problems, though, so commenting and new posts may be delayed for a few days.
UPDATE 2: OK, the weblog is running fine again, upgraded to WP 2.1. This is boring, but let me explain what happened for the possible benefit of someone else out there who is trying to do what I did and might run into some of the same problems.
Originally I wanted to just use the same database and just change the WordPress installation. This is no good if I want to use the DreamHost one-click install, though, because in order to upgrade your one-click install later, the WP installation has to be at the same location and using the same database that DreamHost originally installed it at. That means I had to export my blog and re-import. I used the WordPress Database Backup plugin that comes with WordPress 2.0 for that. Now I could have just deleted the WordPress directory, then reinstalled and reuploaded everything, but that would have involved a lot of down time, and besides, my installation was a little special.
You see, although my blog is in the directory
/life/, that’s not the directory I installed WordPress in. I installed WordPress in another directory off the root. Let’s call it
/abc/. To get this working, all I had to do was change a setting on the Options page and put a
index.php file in the /life/ directory telling the browser where to find all the WordPress files.
So there’s a very simple solution to the upgrade problem. All I had to do was use DreamHost’s one-click install to put version 2.1 in a new WordPress directory (let’s call it
/xyz/), then import all my old files, and upload my old theme and my old plugins to the new directory. Then I could run the upgrade script to upgrade my database to the new format, change the
index.php in the
/life/ to point to the new WordPress directory in
/xyz/, and I’d be done, right? Simple.
Well, that was the theory, anyway. I ran into a minor snag.
There’s a field in the WordPress database telling WordPress what directory its files are installed in. When I imported the old database, it was still pointing to the old WordPress directory. So, for example, if I clicked on “upgrade database” at
/xyz/upgrade.php, it would take me to a page in the
/abc/ directory. When I tried to log in at
/xyz/wp-login.php, it kept taking me to a page in
/abc/ and telling me I had the wrong password. In short, with the wrong WordPress directory in the database, the WordPress installation was unusable. Furthermore, if you’re not paying close attention to the URLs you’re going to and your WP directories are very similar, you might not even realize what’s going on right away. I was confused for a good 5 minutes myself.
.SQL database file is a text file, and it’s not too hard to open it up with a good text editor (not Word!) and edit the offending field. After uploading that, it would work fine. This is where I hit another snag.
Every time I tried to upload the new, edited file in phpmyadmin, I got, “
error, no input specified.” I should mention that right around this time, my internet connection also totally crapped out on me. Since it was a rather large file (over 4 MB) I couldn’t be sure if I was getting the error because the connection was bad and the file was too big, or because I had changed the file and something about the format I saved it in was not right.
In the end, I imported the original (unedited) database file, then cut out and edited only the small section which contained the WP directory part. That overwrote the other imported WP directory. (I’m not sure if this worked because of the way I did it or because the internet suddenly started behaving again.) After that, everything proceeded according to plan.