How to move blog from MovableType 5.27 to WordPress 3.7

There are very few guide on web about migrate blog from MovableType 5.27 to WordPress 3.7.
Here is my own experience to do it.

Step 1: Prepare the data on MovableType 5.27

Using MovableType export function is not enough, because the exported file has entries, tags and comments, but no keywords.
When WordPress import plugin working on this type of export file, it will not import tags. It only import MovableType keywords as WordPress tags.
So that, I found an solution to export MovableType with keywords, which are actually tags in MovableType.
Add a new template file. Add following into it and publish it.


AUTHOR: <$MTEntryAuthor strip_linefeeds="1"$>
TITLE: <$MTEntryTitle strip_linefeeds="1"$>
BASENAME: <$MTEntryBasename$>
STATUS: <$MTEntryStatus strip_linefeeds="1"$>
ALLOW COMMENTS: <$MTEntryFlag flag="allow_comments"$>
CONVERT BREAKS: <$MTEntryFlag flag="convert_breaks"$>
ALLOW PINGS: <$MTEntryFlag flag="allow_pings"$>
PRIMARY CATEGORY: <$MTEntryCategory$>
CATEGORY: <$MTCategoryLabel$>
DATE: <$MTEntryDate format="%m/%d/%Y %I:%M:%S %p"$>
TAGS: <$MTTagName quote="1"$>
-----
BODY:
<$MTEntryBody convert_breaks="0"$>
-----
EXTENDED BODY:
<$MTEntryMore convert_breaks="0"$>
-----
EXCERPT:
<$MTEntryExcerpt no_generate="1" convert_breaks="0"$>
-----
KEYWORDS:
<$MTTagName quote="1"$>
-----

COMMENT:
AUTHOR: <$MTCommentAuthor strip_linefeeds="1"$>
EMAIL: <$MTCommentEmail strip_linefeeds="1"$>
IP: <$MTCommentIP strip_linefeeds="1"$>
URL: <$MTCommentURL strip_linefeeds="1"$>
DATE: <$MTCommentDate format="%m/%d/%Y %I:%M:%S %p"$>
<$MTCommentBody convert_breaks="0"$>
-----

PING:
TITLE: <$MTPingTitle strip_linefeeds="1"$>
URL: <$MTPingURL strip_linefeeds="1"$>
IP: <$MTPingIP strip_linefeeds="1"$>
BLOG NAME: <$MTPingBlogName strip_linefeeds="1"$>
DATE: <$MTPingDate format="%m/%d/%Y %I:%M:%S %p"$>
<$MTPingExcerpt$>
-----

--------

After publishing, download the file to local computer. I save it as abc.txt.

Step 2. Import the data into WordPress

I install the plugin Movable Type and TypePad importer v0.4 on WordPress 3.7.

Then import the abc.txt into WordPress. This step is simple.

Step 3. Config the WordPress to keep the directory structure

I would like to keep the Path and folder unchanged.

Change the settings > Permalink as below
permalink-settings

Then original post url https://www.yinfor.com/blog/archives/2012/09/error_booting_centos_in_virtua.html
Changed to new url https://www.yinfor.com/2012/09/error_booting_centos_in_virtua.html
The purpose of it is to simplify the url and make it short.

And I add following into the .htaccess to make the 301 redirection.

RewriteRule ^blog/archives/?(.*).html /$1.html [R=301,L]

Step 4. Copy the media files into new server

It is more complicated. All media files are moved from old server to new server with new path. Then I have to make some search and replace in WordPress Tools facilities.

Such as replace /blog/images/ by /images/

Now, finally David Yin’s Blog is came to normal and I feel much better than before.