The Movable Type Import / Export 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.

  • Metadata
  • Multi-line fields (Body, Extended Body, Excerpt, Comments)

See the example below for an example of a small import file.

Metadata

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

AUTHOR - The author of the entry

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.

TITLE - The title of the entry

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.

DATE - The authored-on date of the entry

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.

PRIMARY CATEGORY - The primary category to which the entry is assigned

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 - A secondary category to which the entry is assigned

Multiple CATEGORY keys can appear in the metadata section; each specifies a secondary category. For example:

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.

STATUS - The post status of the entry.

Valid values are either draft or publish.

ALLOW COMMENTS - The value for the "allow comments" flag for the entry.

Valid values are either 0 or 1.

ALLOW PINGS - The value for the "allow pings" flag for the entry.

Valid values are either 0 or 1.

CONVERT BREAKS - The value for the "convert breaks" flag for the entry.

Valid values are either 0 or 1.

NO ENTRY

A special key used when importing data from a system where you have already imported all of the entries, but not the comments. If you use this, the DATE key is required, and will be used to look up the entries with which the comments are associated; if a matching entry cannot be found by matching the timestamps, the comments will be skipped. You probably don't need to use this.

Example usage:

NO ENTRY: 1

Multi-line fields

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.
-----

BODY - The body of the entry.

EXTENDED BODY - The extended body of the entry.

EXCERPT - The excerpt of the entry.

COMMENT - Represents one comment on this entry.

Multiple COMMENT sections can appear, each separated by the standard multi-line field separator (-----\n).

In a COMMENT section, the following fields are applicable:

  • AUTHOR The name of the author of the comment.
  • EMAIL - The email address of the author of the comment.
  • URL - The URL of the author of the comment.
  • IP - The IP Address of the author of the comment.
  • DATE - The date on which the comment was posted. This should be in the same format as the DATA metadata key, above.

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.

PING - Represents one TrackBack ping on this entry.

Multiple PING sections can appear, each separated by the standard multi-line field separator (-----\n).

In a PING section, the following fields are applicable:

  • TITLE - The title of this ping.
  • URL - The URL to the original entry.
  • IP - The IP address of the server that sent the ping.
  • BLOG NAME - The name of the weblog from which the ping was sent.
  • DATE - The date on which the ping was sent.

This should be in the same format as the DATA metadata key, above.

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.

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.
-----
--------
This page was last updated on 2007-08-02, 14:24.  

9 Notes

I have ALLOW COMMENTS: 2 in many of my entries - does this correspond to "closed" rather than "not allowed" (0) vs. "open" (1)?

The BASENAME field is not discussed on this page, but it part of files exported from MT4. Can the format and parsing of this field be added, please?

Some of my MT4-exported entries have a value of 2 for ALLOW COMMENTS. I assume this indicates "comments now closed" rather than "comments never enabled" (0) or "comments currently open" (1)?

The BASENAME field is not discussed on this page, but it part of files exported from MT4. Can the format and parsing of this field be added, please?

I have ALLOW COMMENTS: 2 in many of my entries - Flomax ISOdoes this correspond to "closed" rather than "not allowed" (0) vs. "open" (1)?

The basic import format is a list of entries, separated by the string --------\n (that is eight - characters, followed by a carriage return).

I'm not sure which character is expected to terminate these lines, or if it even matters. The explanation acts like a "\n" and a "carriage return" are the same character, but they are not. "Carriage return" refers to "\r" (ASCII 0xD), and the "\n" is called a "new line" (ASCII 0xA).

Is a certain character expected to end the lines, or will either/both of the characters work?

check this site for more software rapidshare search

What about doing a mass import of assets like photos? I tried the old format for MT 3.3, the entries were created but I think the links were brokent.

I am not surprised as the way assets are now handled is vastly different from MT 3.3. Any help?

The Asset Handler plugin should take care of that for you I think. Simply point it to a file or directory and it'll import it into Movable Type as an asset :)

Leave a note