mtimport - Movable Type Import Format
This document describes the format required by the Movable Type import mechanism, which can be used to import entries and comments from other content management systems.
The basic import format is a list of entries, separated by the string
--------\n
(that is eight -
characters, followed by a carriage return).
Each entry can be broken into two main sections; these sections are
separated by the string -----\n
(that is five -
characters, followed
by a carriage return).
If you have HTML in the data that you are importing, it should not be encoded into HTML entities; the data that is in your import file is imported verbatim into the Movable Type database. Thus, your data should look exactly as it would were you to type it into the form when creating a new entry.
See EXAMPLE, below, for an example of a small import file.
Each piece of metadata is formatted as KEY: VALUE
, and one piece of
metadata is separated from the next by a carriage return. The order of the
metadata pieces is not important.
For example:
AUTHOR: Foo Bar TITLE: A dummy title DATE: 01/31/2002 03:31:05 PM CATEGORY: News
If the author name does not exist, a new MT::Author record will be created, and the author will be assigned posting permissions to the weblog into which you're importing the entries. The entry will then be assigned to the new author. If the author name does exist, the entry will be assigned to the existing author.
This is ignored if you have checked the Import entries as me
checkbox
before importing; it is required otherwise.
If you do not specify a title, a title will be generated automatically from
the first five (5
) words in the entry body.
This is optional.
This should be in the format MM/DD/YYYY hh:mm:ss AM|PM
. AM|PM
is
optional, and if not present the hh
will be intrepreted as being in
military time.
This is required.
If the category name does not exist, a new MT::Category record will be created, and the entry will be assigned to the new category. If the category name does exist, the entry will be assigned to the existing category.
CATEGORY: Foo CATEGORY: Bar
If the category name does not exist, a new MT::Category record will be created, and the entry will be assigned to the new category. If the category name does exist, the entry will be assigned to the existing category.
If the category specified in PRIMARY CATEGORY is also listed as a CATEGORY, it will be dropped from the list of secondary categories automatically, and will be set as the primary category.
If you do not provide a PRIMARY CATEGORY, but you do provide one or more secondary categories via CATEGORY, the first CATEGORY will be used as a primary category rather than as a category.
draft
or publish
.
0
or 1
.
0
or 1
.
0
or 1
.
Example usage:
NO ENTRY: 1
Multi-line fields are separated by -----\n
(that is five -
characters,
followed by a carriage return). Each multi-line field is started by the key
denoting the type of field, followed by a carriage return, followed by the
actual body of the field.
For example:
BODY: This is the body. ----- EXTENDED BODY: Here is some more text. ----- COMMENT: AUTHOR: Foo DATE: 01/31/2002 15:47:06 This is the body of this comment. ----- PING: TITLE: Foo Bar URL: http://www.foo.com/baz/archives/000015.html DATE: 08/05/2002 04:05:23 PM This is the excerpt of the ping. -----
-----\n
).
In a COMMENT section, the following fields are applicable:
Any line that does not match one of the above keys starts the body of the comment; the body of the comment then consists of everything from that point to the end of the COMMENT section. If this is unclear, look below at the EXAMPLE.
-----\n
).
In a PING section, the following fields are applicable:
Any line that does not match one of the above keys starts the ping excerpt; the excerpt then consists of everything from that point to the end of the PING section. If this is unclear, look below at the EXAMPLE.
TITLE: A dummy title AUTHOR: Foo Bar DATE: 01/31/2002 03:31:05 PM PRIMARY CATEGORY: Media CATEGORY: News ----- BODY: This is the body. ----- EXTENDED BODY: Here is some more text. ----- COMMENT: AUTHOR: Foo DATE: 01/31/2002 15:47:06 This is the body of this comment. ----- COMMENT: AUTHOR: Bar DATE: 02/01/2002 04:02:07 AM IP: 205.66.1.32 EMAIL: me@bar.com This is the body of another comment. It goes up to here. ----- PING: TITLE: My Entry URL: http://www.foo.com/old/2002/08/ IP: 206.22.1.53 BLOG NAME: My Weblog DATE: 08/05/2002 16:09:12 This is the start of my entry, and here it... ----- -------- TITLE: Here is a new entry AUTHOR: Baz Quux DATE: 01/31/2002 03:31:05 CATEGORY: Politics ----- BODY: This is the body of the second entry. It can consist of multiple lines. ----- EXCERPT: See, this entry does not have an extended piece; but it does have an excerpt. It is special. ----- COMMENT: AUTHOR: Quux URL: http://www.quux.com/ DATE: 01/31/2002 04:23:01 PM Here is the first comment on this entry. ----- --------