Converting from MT 3.34 to WP 2.65

I recently had the opportunity to convert a large-ish Movable Type system to WordPress for speed testing and usability evaluation. By “large-ish” I mean 12,038 posts, and 43,043 comments. This may not be large by others’ standards, but it was plenty large to me.

Here are some of the steps I took. If you’re facing a similar conversion, I hope this information saves you some trouble.

  • Before exporting from MT, I did a GREP search and replace on the entries and comments, as some authors and commenters had used multiple hyphens as separators (e.g. “———“). I already knew that MT uses multiple hyphens as separators in its export file, so to avoid confusion, I replaced all such runs with dots (e.g. “………”). Note that you can do this on the exported text file, too, but then you have to worry about munging valid separators.
  • I exported the entries and comments from MT. This gave me a 70.1 megabyte file.
  • I converted all special characters to ASCII. I wanted a file with no smart quotes, m-dashes, etc.
  • I converted all HTML entities into ASCII. Note that WP will do this conversion on import, but I got better results converting the entities before import.
  • I did some general clean-up, such as eliminating multiple newlines, although you can get into trouble doing this, because there are places where multiple newlines are expected. Use your own judgment.
  • I split the file into 10 megabyte sections.
  • I checked the end of each section against the beginning of the next section, moving text around so that every entry was contained in one file, with its associated comments, if any.
  • I set up a scratch installation of WP on my local computer.
  • I imported each 10 megabyte section into WP, then exported that section as a WordPress XML file, and then in phpMyAdmin emptied the MySQL table of posts, comments, and relationships before importing the next section.
  • I repeated this last step until I had eleven WP XML export files.
  • I transferred the eleven WP XML export files to the server (wp : wp-admin : wp-content).
  • I imported each file into WP.

Without breaking up the large file into smaller files, I was getting partial imports, time-outs, etc. It was a real hassle. Even breaking up the MT export file into pieces, and attempting to import those into WP proved problematic. However, pre-processing them through my scratch installation of WP worked well — especially with the smaller files.