Moving MT Archives to new server

When I first thought about moving my blog to a new host, I thought it would be a piece of cake. Getting the domain moved, server working, and MovableType installed were a cinch because I've dealt with all that before, but I did run into one hurdle that I didn't expect: Redirecting MovableType archives.

The problem existed because, by default, MT archives are built with numeric entry numbers. So, an archive for a post might look something like this:

http://blog.kevindonahue.com/archives/000687.php

But, if you move servers and start a new database, there's a pretty good chance that something somewhere is going to get fouled up/renumbered when you import the new entries. (Granted, there's probably more than a few ways to move the existing sql database, but I was somewhat concerned that I would just hose the whole thing, so I imported the old fashioned way).

Assuming that you may have deleted a post or two somewhere along the line (or moved to your own database, perhaps), the archive for that same post on the new host might look like this:

http://blog.kevindonahue.com/archives/000622.php

Therefore, anyone visiting from a search engine or bookmark is probably going to see something completely different than they expected to find.

I was pretty stumped on the best way to remedy this problem until I happened on David Ely's website and noticed that he had posted an entry on How to Migrate Archives from MT to Typepad. It was then and there that I realized that this would work very easily for moving movabletype servers as well.

So, following David's advice, here's the steps I took to redirect my MovableType archives:

  1. Back up my current Individual Entry Archive template.
  2. Replace the current template with a version of David's template.
  3. Rebuild the entire site with David template as my Individual Entry Archive template.
  4. Revert back to your standard Individual Entry Archive template.
  5. Change the archive style in the MT config page to the following: <$MTEntryDate format="%Y/%m"$>/<$MTEntryTitle dirify="1" trim_to="15"$>.php. (My pages are php, you may need to set your file extension to .html depending on your site configuration.
  6. Rebuild the entire site again with the normal page template, but the new archive structure.
  7. Download (ftp) the archives directory and upload to new host.
  8. Export the posts from the old blog and import them on the new blog.

I'll be the first to say that it took a little trial and error. In the end, it really wasn't that hard. Hope this helps if you're trying to redirect your MT archive pages.

Share on FacebookTweet about this on TwitterShare on LinkedInEmail this to someone

4 thoughts on “Moving MT Archives to new server”

  1. That's one of the things I've always loved about cPanel – we've been able to move an entire account and bring it back in to place with the original numbering intact when needed. Makes a hosting company move so much easier! But I'm going to have to remember this too – not everyone has cPanel on their original host!

  2. In retrospect, I guess the easiest way to have done this would have been to hack the export function to include the entry id. I don't know why that's not part of MT. I hope they can add that to future versions – sure would have saved the headache.

Comments are closed.