Movable TypeからWordPressへ完全移行方法を10段階でまとめ

Movable Typeの使い勝手が悪いわけでもないけど、WordPressだとすごく簡単にできるということがすごく多い。それを知って以降を決断する人も多いと思う。Movable TypeからWordPressへの移行は結構大変です。

■記事の移転方法

1、Movable Typeのインデックステンプレートを適当な名前で作成する。「export.xml」で出力するように設定し、再構築。テンプレートの中身は下。

<?xml version=”1.0″ encoding=”UTF-8″?>

<rss version=”2.0″
xmlns:content=”http://purl.org/rss/1.0/modules/content/”
xmlns:wfw=”http://wellformedweb.org/CommentAPI/”
xmlns:dc=”http://purl.org/dc/elements/1.1/”
xmlns:wp=”http://wordpress.org/export/1.0/”
>

<channel>
<title><$MTBlogName$></title>
<link><$MTBlogURL$></link>
<description><$MTBlogDescription$></description>
<language>ja</language>
<wp:wxr_version>1.1</wp:wxr_version>
<wp:base_site_url><$MTBlogURL$></wp:base_site_url>
<wp:base_blog_url><$MTBlogURL$></wp:base_blog_url>
<MTSetVarBlock name=”ecount”><$MTBlogEntryCount$></MTSetVarBlock>
<MTEntries lastn=”$ecount”>
<item>
<title><$MTEntryTitle$></title>
<link><$MTEntryPermalink$></link>
<pubDate><$MTEntryDate format=”%Y-%m-%d %H:%M:%S”$></pubDate>
<dc:creator><![CDATA[<$MTEntryAuthor$>]]></dc:creator>
<category><![CDATA[<$MTEntryCategory$>]]></category>

<category domain=”category” nicename=”<$MTEntryCategory$>”><![CDATA[<$MTEntryCategory$>]]></category>
<MTEntryIfTagged>
<MTEntryTags>
<category domain=”tag”><![CDATA[<$MTTagName$>]]></category>

<category domain=”tag” nicename=”<$MTTagName$>”><![CDATA[<$MTTagName$>]]></category>
</MTEntryTags></MTEntryIfTagged>

<guid isPermaLink=”false”><$MTBlogURL$>/wp/?p=<$MTEntryID$></guid>
<description></description>
<content:encoded><![CDATA[<$MTEntrybody$>
<mt:IfNonEmpty tag=”MTEntryMore”><!–more–><$MTEntryMore$></MTIfNonEmpty>
]]></content:encoded>
<guid isPermaLink=”false”><$MTEntryPermalink$></guid>
<excerpt:encoded><![CDATA[<$MTEntryExcerpt$>]]></excerpt:encoded>
<wp:post_id><$MTEntryID$></wp:post_id>
<wp:post_date><$MTEntryDate format=”%Y-%m-%d %H:%M:%S”$></wp:post_date>
<wp:post_date_gmt><$MTEntryDate format=”%Y-%m-%d %H:%M:%S”$></wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:post_name><$MTEntryBasename$></wp:post_name>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:postmeta>
<wp:meta_key>_edit_lock</wp:meta_key>
<wp:meta_value>1221409228</wp:meta_value>

<MTComments sort_order=”ascend”>
<wp:comment>
<wp:comment_id><$MTCommentID$></wp:comment_id>
<wp:comment_author><![CDATA[<$MTCommentAuthor$>]]></wp:comment_author>
<wp:comment_author_email><$MTCommentEmail$></wp:comment_author_email>
<wp:comment_author_url><$MTCommentURL$></wp:comment_author_url>
<wp:comment_author_IP><$MTCommentIP$></wp:comment_author_IP>
<wp:comment_date><$MTCommentDate format=”%Y-%m-%d %H:%M:%S”$></wp:comment_date>
<wp:comment_date_gmt><$MTCommentDate format=”%Y-%m-%d %H:%M:%S”$></wp:comment_date_gmt>
<wp:comment_content><![CDATA[<$MTCommentBody convert_breaks=”1″$>]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
</MTComments>

<MTPings sort_order=”ascend”>
<wp:comment>
<wp:comment_id><$MTPingID$></wp:comment_id>
<wp:comment_author><![CDATA[<$MTPingBlogName$>]]></wp:comment_author>
<wp:comment_author_email></wp:comment_author_email>
<wp:comment_author_url><$MTPingURL$></wp:comment_author_url>
<wp:comment_author_IP><$MTPingIP$></wp:comment_author_IP>
<wp:comment_date><$MTPingDate format=”%Y-%m-%d %H:%M:%S”$></wp:comment_date>
<wp:comment_date_gmt><$MTPingDate format=”%Y-%m-%d %H:%M:%S”$></wp:comment_date_gmt>
<wp:comment_content><![CDATA[<strong><$MTPingTitle$></strong>
<$MTPingExcerpt$>
…]]></wp:comment_content>
<wp:comment_approved>1</wp:comment_approved>
<wp:comment_type>trackback</wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
</wp:comment>
</MTPings>
</item>
</MTEntries>
</channel>
</rss>​

2、ftpツールなどで、出力された「export.xml」をダウンロード。

3、「export.xml」をテキストツールなどで開き、「<wp:post_name>」タグの中身の「post_1」を「post-1」というように全て、アンダーバーをハイフンに置き換える。秀丸など正規表現を使えるテキストエディッタがいい。

4、WordPressをインストール後、パーマリンクの設定からMovable TypeでのURLに合わせて変更する。「/%year%/%monthnum%/%postname%.html」のような感じ。

5、WordPressのツールからインポート。

6、カテゴリのスラングをMovable Typeに合わせて個別に設定し直す。

7、プラグイン「MT Style Post Name Kai」をインストール。新規urlを自動的に英数字にしてくれる。

8、プラグイン「WP No Category Base」をインストール。Movable Typeに合わせて、カテゴリのurlから「category」を削除してくれる。

プラグインを導入することで解決できる部分は多いので、移行ができれば、ある程度その後に楽をできるという部分はあると思う。

9、ping送信先の追加

mtで送っていたところへwpでも送るようにする。

設定>投稿設定>更新情報サービス

10、twitterの自動投稿設定の移植

プラグインのWP to Twitterをインストール

11、CKEditerのインストール

記事投稿ようのプラグイン

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です