Adventures in Upgrading: How to Do Fresh Install (I Think)

I mentioned that I was going to blog through my MT 4.2 upgrade experience. This is the second post in that series.

Update 10/09/2008 - Added instructions on pointing Typekey to your new install.

Update 10/04/2008 - After some feedback on the MT support forums, I've changed this to separate the MT upgrade from upgrading plugins. Still would like any clarification from folks who know better.

In my first Adventures in Upgrading post I said this about Six Apart's recommended install method for MT:

What I think is wrong is that in step 4 it directs you to copy the new MT files over top of the old MT files. Nothing wrong with that in general, and even if something went wrong you could re-install the old version of MT, but I prefer to leave the old version intact and install the new along side, in a separate directory. Why? Because if (when?) something does go wrong that's not easily fixed, you can simply re-load the database backup you made in step 1 and go back to the old version until you figure out what went wrong. If you've overwritten the old installation with the new, you have to re-overwrite the new with the old to go back. The upgrade page mentions this, but as an alternate method rather than the preferred method. That's backwards, in my opinion.

Well, I've since learned why Six Apart recommends the copy over method. The fresh install method is significantly more challenging and it's easier to mess it up. It's been a while since I did an upgrade (the upgrade to MT 3.33 was two years ago) and I had forgotten the extra work needed when doing a clean install. The old upgrade guide for MT 3.33 at Learning Movable Type lists 14 steps for a fresh install, vs. 6 for the overwrite install at movabletype.org. For the many users, the overwrite install is probably the better choice. For major upgrades like this one, I still like the clean slate approach.

The problem is, I don't know which of those extra steps are still needed and which are not or if there are others that should be added because there is no documented 'fresh install' instructions, that I have found, for MT 4.2. The Six Apart Upgrade guide mentions the fresh install as does the Community Upgrade Guide on the MT wiki (down as of this writing), but no where is it described in detail. I've asked on the MT support forums about it, but haven't gotten any answer yet.

Looking at the old MT 3.33 post at Learning Movable Type, here is my interpretation of the steps as they apply to MT 4.2:

  1. Do not attempt to do an upgrade late at night when you are about to go to sleep and no one on earth is awake who can help you if you screw up.

  2. Back up your database. (See Backing Up Your Blog).

  3. Create a new directory on your server for the MT4.2 program files. If your existing MT files are in a directory called "mt" or "mt_3-2", label this new directory something like "mt42" or "mt4", so you can tell the difference.

  4. Download MT4.2 from Six Apart.

  5. Unzip the file to your local PC and upload the files to the new directory on your server. If your new directory is in the cgi-bin, make sure you upload the mt-static directory outside of the cgi-bin, to somewhere in your public_html directory. Upload the images in the mt-static directory as binary files. Upload all other files as text. If you have command line access to your server, you can save a bunch of upload time by downloading the tar.gz file (instead of the zip), uploading it to the server and unzipping there. Instructions on doing that here.

  6. If you have made custom search templates, copy those over to the new search template directory.

  7. Compare your old mt-config.cgi settings to the new settings in mt-config.cgi-original. Using a text editor, copy the relevant settings over to the new config file. Most importantly, put your DB info and password in the new mt-config.cgi-original where indicated. Also note that you should have a new cgi path on the config file, as you have put your MT files in a new directory. A complete listing of MT Configuration Directives can be found here. Copy over directives from your old mt-config.cgi file that are not default directives into your new mt-config.cgi-original file.

  8. Change the name of mt-config.cgi-original to mt-config.cgi. Set permissions of all the cgi files in the new installation to 755, with the exception of the mt-config.cgi file. Set the permissions of mt-config.cgi to 644. This is important because your database login info is there and you don't want to grant everyone access to it.

  9. Point your web browser to the location of the new mt.cgi file. The program should automatically recognize that you are doing an upgrade and it should prompt you to upgrade. If this doesn't happen, make sure you have done all the previous steps. You might also want to clear your browser cache before pointing to the new mt.cgi file.

  10. Rebuild all of your blogs.

  11. Copy or install all your plugins to the new plugin directory in the new MT directory. You need to do some digging here and find out which ones need new versions and which don't. For the ones that don't, you can copy these from your old MT directory to the new MT directory in the same place (if they are in the extlib directory, copy them to the new extlib directory). For the plugins that have a new version, install that version per the instructions from the developer.

    For any more complicated plugins that have their own upgrade or install routine (aside from simply copying the files over), you may want to do them one at a time, rebuilding in between, so that the install processes aren't trying to run simultaneously.


  12. Rebuild all of your blogs again. Frankly, I'm not sure if all these rebuilds are necessary. You may only need one rebuild after all the upgrade processes the main MT upgrade and any plugin upgrades) are complete. If not needed, I think that the only thing multiple rebuilds will do is waste your time.

  13. Once everything is working, remove permissions from your old CGI scripts. After you have completed your upgrade change the permissions of the current mt-upgrade.cgi to 644. After everything's been working for a while, you can remove the old installation folder from your server.

  14. If you use Typekey, you'll need to update your Tyepkey profile so that it points to the new installation. Log in to your Typekey account and you'll find the settings at the bottom of your Acount Profile page. Any other services that interact with your MT installation (like Flickr's email to blog feature) will need to be updated as well.

So there you go, how to do the clean install. Keep in mind that this is the thinking of a guy who hasn't done an upgrade in 2 years and is not a professional MT guru. If anyone has any additional info or corrections, please add it in the comments.

2 Comments

Thanks for this post - so much more helpful than the actual documentation!



Monthly Archives

Recent Comments

Close