0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Movable Type]特定のコンテンツタイプのデータを丸ごとブログ移動する、ほか

Posted at

環境

  • Movable Type 7 r4208

管理画面からはできないので、SQLで行う。
すべて自己責任で。

コンテンツタイプを丸ごとブログ移行

コンテンツタイプID=5のタイプとデータを丸ごとブログID=6に移動する場合。
コンテンツタイプIDやブログIDはURL等から推測。

UPDATE mt_content_type SET content_type_blog_id = 5 WHERE content_type_id = 6;
UPDATE mt_cf SET cf_blog_id = 5 WHERE cf_content_type_id =6;
UPDATE mt_cd SET cd_blog_id = 5 WHERE cd_content_type_id =6;

テンプレートをブログ移行

テンプレートID=209をブログID=5に移行する場合。
テンプレートIDやブログIDはURL等から推測。

UPDATE mt_template SET template_blog_id = 5 WHERE template_id =209;

テンプレートをブログまたいで複製

テンプレートID=198をブログID=5に複製する場合。
テンプレートID以外を選択してINSERT。

INSERT INTO mt_template (`template_blog_id`, `template_build_dynamic`, `template_build_interval`, `template_build_type`, `template_created_by`, `template_created_on`, `template_identifier`, `template_linked_file`, `template_linked_file_mtime`, `template_linked_file_size`, `template_modified_by`, `template_modified_on`, `template_name`, `template_outfile`, `template_rebuild_me`, `template_text`, `template_type`, `template_current_revision`, `template_content_type_id`)
SELECT 5, `template_build_dynamic`, `template_build_interval`, `template_build_type`, `template_created_by`, `template_created_on`, `template_identifier`, `template_linked_file`, `template_linked_file_mtime`, `template_linked_file_size`, `template_modified_by`, `template_modified_on`, `template_name`, `template_outfile`, `template_rebuild_me`, `template_text`, `template_type`, `template_current_revision`, `template_content_type_id`
FROM `mt_template`
WHERE template_id=198

その他

同じような方法でページやブログ記事等のデータ(主にmt_entryテーブル)を移行できるのではないかと思う。
ブログ記事についてはカスタムフィールド(mt_field/mt_entry_metaなど)に注意。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?