wordpress移行(Blogシステム移行)

wordpresslogoBlogをこれまで利用していたWordPress MEからXPressMEに移行しました。

WordPressMEでも不都合は無かったのですが、最近メンテナンスが少ないのと、本家WordPressが遥か先のバージョンまでアップデートが進んでしまったので、とりあえず、比較的新型を追っているmoduleへアップデートをしました。

これまでの投稿内容は力技で移行したので、ちとまともに移行されたか心配なのですが、まあ、しばらくはこれで様子をみることにします。

力技の内容はこのあと


STEP1. まずはXPressMEのモジュールをインストールし、あとはSQL直たたきで..
ちなみに、新WPのテーブルは*** 旧WPのテーブルはx2_wp_***です。
STEP2. Postsの移行

mysql> insert ignore into posts (ID,post_author,post_date,post_content,post_title,post_category,post_excerpt,post_status,comment_status,ping_status,post_name,pinged,post_modified) select ID,post_author,post_date,post_content,post_title,post_category,post_excerpt,post_status,comment_status,ping_status,post_name,pinged,post_modified from posts as T1 union select ID,post_author,post_date,post_content,post_title,post_category,post_excerpt,post_status,comment_status,ping_status,post_name,pinged,post_modified from x2_wp_posts as T2;
Query OK, 519 rows affected (0.08 sec)
Records: 521  Duplicates: 2  Warnings: 0

STEP3. Categoriesの移行

mysql> TRUNCATE TABLE `categories`
-> ;Query OK, 0 rows affected (0.05 sec)

mysql> INSERT IGNORE INTO categories (cat_ID,cat_name,category_nicename,category_description,category_parent) select cat_ID,cat_name,category_nicename,category_description,category_parent from x2_wp_categories;Query OK, 13 rows affected (0.01 sec)Records: 13  Duplicates: 0  Warnings: 0mysql>

STEP4. Commentsの移行

mysql> INSERT IGNORE INTO comments (comment_ID,comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_author_IP,comment_date,comment_content,comment_karma,comment_approved,comment_agent,comment_type,comment_parent,user_id) SELECT comment_ID,comment_post_ID,comment_author,comment_author_email,comment_author_url,comment_author_IP,comment_date,comment_content,comment_karma,comment_approved,comment_agent,comment_type,comment_parent,user_id FROM x2_wp_comments;
Query OK, 6005 rows affected (0.16 sec)
Records: 6005  Duplicates: 0  Warnings: 0

mysql> INSERT IGNORE INTO post2cat(rel_id,post_id,category_id)  SELECT rel_id,post_id,category_id FROM x2_wp_post2cat;
Query OK, 849 rows affected (0.02 sec)
Records: 849  Duplicates: 0  Warnings: 0

STEP5. カテゴリー別投稿数の拾い出し
これは、旧バージョンではそもそも投稿数の絡むが無いため、このままだと、カテゴリ毎の投稿数の整合性がとれないから行います。手で投稿数を拾いだして、登録しなおしました。まさに力技…

mysql> SELECT category_id,count(*) from post2cat group by category_id;
+————-+———-+
| category_id | count(*) |
+————-+———-+
|           1 |      409 |
|           2 |       69 |
|           3 |        6 |
|           4 |       62 |
|           5 |       63 |
|           6 |       28 |
|           7 |       25 |
|           8 |       17 |
|           9 |      124 |
|          10 |       16 |
|          11 |        2 |
|          12 |       27 |
|          13 |        1 |
+————-+———-+
13 rows in set (0.00 sec)

–あとは手で各カテゴリの投稿数を登録して、結果を確認すればおわり–

wordpress移行(Blogシステム移行)」への1件のフィードバック

joey へ返信する コメントをキャンセル

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

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください