Home > WordPress > wordpressインポート・エクスポート

wordpressインポート・エクスポート

wordpressでインポートするとき、
エクスポートされるデータが
日付があっちいったりこっちいったりで、
記事番号が昇順でなかったりすると、
巧くインポートされないとか聞いてたので、ローカルで試してみた。

確認してみたら番号を改めて振りなおすのね。
だから日付毎になるんだかなんだか知らんが、変な記事順になる。

POSTIDを維持したままインポートする方法

これが結構単純に出来たりする。

巧くインポートされなかったのはデータがあるwordpress。
つまり記事データがある状態でインポート。
要は消しちゃえばいいんじゃない?
て試してみたらアタリ。

wordpressの
『wp_posts』『wp_term_relationships』『wp_term_taxonomy』『wp_terms』の4本のテーブルを
create文を取得したあと、消す。

作り直す。
それからインポート。

こ れ だ けー!

すると、IDが保持されてるのだ!
なんて単純で優しくてありがとう!


create文を取得し忘れたキミへ

CREATE TABLE "wp_posts" (
 "ID" integer PRIMARY KEY  NOT NULL ,
 "post_author" integer NOT NULL  DEFAULT '0' ,
 "post_date" datetime NOT NULL  DEFAULT '0000-00-00 00:00:00' ,
 "post_date_gmt" datetime NOT NULL  DEFAULT '0000-00-00 00:00:00' ,
 "post_content" text NOT NULL ,
 "post_title" text NOT NULL ,
 "post_category" integer NOT NULL  DEFAULT '0' ,
 "post_excerpt" text NOT NULL ,
 "post_status" text NOT NULL  DEFAULT 'publish' ,
 "comment_status" text NOT NULL  DEFAULT 'open' ,
 "ping_status" text NOT NULL  DEFAULT 'open' ,
 "post_password" text NOT NULL  DEFAULT '' ,
 "post_name" text NOT NULL  DEFAULT '' ,
 "to_ping" text NOT NULL ,
 "pinged" text NOT NULL ,
 "post_modified" datetime NOT NULL  DEFAULT '0000-00-00 00:00:00' ,
 "post_modified_gmt" datetime NOT NULL  DEFAULT '0000-00-00 00:00:00' ,
 "post_content_filtered" text NOT NULL ,
 "post_parent" integer NOT NULL  DEFAULT '0' ,
 "guid" text NOT NULL  DEFAULT '' ,
 "menu_order" integer NOT NULL  DEFAULT '0' ,
 "post_type" text NOT NULL  DEFAULT 'post' ,
 "post_mime_type" text NOT NULL  DEFAULT '' ,
 "comment_count" integer NOT NULL  DEFAULT '0'
);
CREATE TABLE wp_term_relationships (
 object_id  integer NOT NULL default 0,
 term_taxonomy_id  integer NOT NULL default 0,
 term_order   integer NOT NULL default 0,
 PRIMARY KEY  (object_id,term_taxonomy_id)
);
CREATE TABLE "wp_term_taxonomy" (
 "term_taxonomy_id" integer PRIMARY KEY  NOT NULL ,
 "term_id" integer NOT NULL  DEFAULT 0 ,
 "taxonomy" text NOT NULL  DEFAULT '' ,
 "description" text NOT NULL ,
 "parent" integer NOT NULL  DEFAULT 0 ,
 "count" integer NOT NULL  DEFAULT 0
);
CREATE TABLE wp_terms (
 term_id  integer NOT NULL  PRIMARY KEY AUTOINCREMENT ,
 name   text NOT NULL default '',
 slug   text NOT NULL default '',
 term_group  integer NOT NULL default 0,
 "term_order" INTEGER DEFAULT 9999
);
タグ:

関連する投稿

Comments:0

Comment Form
Remember personal info

Trackbacks:0

Trackback URL for this entry
http://qooga.jb-jk.net/wp/2009/10/wordpress%e3%82%a4%e3%83%b3%e3%83%9d%e3%83%bc%e3%83%88%e3%83%bb%e3%82%a8%e3%82%af%e3%82%b9%e3%83%9d%e3%83%bc%e3%83%88/trackback/
Listed below are links to weblogs that reference
http://qooga.jb-jk.net/wpwordpressインポート・エクスポート from MOT:主にプログラム勉強メモ部屋

Home > WordPress > wordpressインポート・エクスポート

Search
Option
  • Twitter
  • 絵板
Feeds
commercial
Mobile
Meta
Tag Cloud
TOP10
commercial

Return to page top