Not a developer? Go to MovableType.com

Documentation

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.

There are two types of data fields:

  • Single-line Data
  • Multi-line Data Fields (Body, Extended Body, Excerpt, Comments)

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

Single-line Data

Each piece of data is formatted as KEY: VALUE, and one piece of data is separated from the next by a carriage return. The order of the data 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.

BASENAME

The basename of the entry

All lowercase, no spaces, no punctuation other than dashes and underscores. Must be a unique value for each entry.

DATE

The authored-on or published date of the entry

This should be in the format MM/DD/YYYY hh:mm:ss AM|PM. The 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 data section; each specifies a secondary category. For example:

CATEGORY: Foo
CATEGORY: Bar

If the category name does exist, the entry will be assigned to the existing category. 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 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 a PRIMARY CATEGORY is not specified, but one or more CATEGORY elements are specified, the first CATEGORY will be used as a primary category rather than as a category.

TAGS

The tags associated with an entry.

Comma separated list of tags. Multi-word tags should be placed in quotes.

TAGS: "San Francisco",California,foo,bar

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.

  • 0 - raw html
  • 1 - convert line breaks to <br />
  • __default__ - will default to the text formatting option specified in blog entry settings
  • markdown_with_smartypants - Markdown with Smartypants
  • markdown - Markdown
  • textile_2 - Textile 2
  • richtext - Rich Text via HTML text editor

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 Data

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.

Another paragraph here.

Another paragraph here.
-----
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.

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.

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

Here’s an example of two entries with comments and TrackBacks.

TITLE: A dummy title
BASENAME: a-dummy-title
AUTHOR: Foo Bar
DATE: 01/31/2002 03:31:05 PM
PRIMARY CATEGORY: Media
CATEGORY: News
-----
BODY:
This is the body.

Another paragraph here.

Another paragraph here.
-----
EXTENDED BODY:
Here is some more text.

Another paragraph here.

Another paragraph here.
-----
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
BASENAME: 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.
-----
--------
Back

14 Comments

kelly42.myopenid.com

kelly42.myopenid.com on September 4, 2007, 5:14 p.m. Reply

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

kelly42.myopenid.com

kelly42.myopenid.com on September 4, 2007, 9:19 p.m. Reply

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?

Kelly

Kelly on September 8, 2007, 3:14 p.m. Reply

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)?

Flomax

Flomax on November 16, 2007, 12:31 a.m. Reply

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?

Flomax

Flomax on November 16, 2007, 12:50 a.m. Reply

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

Bryant

Bryant on February 14, 2008, 3:54 p.m. Reply

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?

Nelly

Nelly on February 27, 2008, 11:04 p.m. Reply

check this site for more software rapidshare search

highdiver_2000

highdiver_2000 on July 6, 2008, 9:47 p.m. Reply

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?

Arvind Satyanarayan

Arvind Satyanarayan on July 25, 2008, 9:31 p.m. Reply

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 :)

Dave Aiello

Dave Aiello on June 10, 2009, 3:36 p.m. Reply

If you are creating your own import file by hand, the keys / field labels must be written in ALL CAPS. In other words:

  • TITLE
  • AUTHOR
  • DATE

and so on.

Beau Smith

Beau Smith on November 23, 2009, 1:01 p.m. Reply

The format for tags:

TAGS: "Martin Cate",tiki,foo,bar,"San Francisco"
Travis Spencer

Travis Spencer on February 18, 2010, 11:43 p.m. Reply

I exported my blog from MT 4 running on a Linux box, copied/pasted some entries (that were new since the last import) into Notepad2 running on my Windows workstation, and imported them into MT 5 running on a Linux machine. No entries were imported. I changed the line endings to those used in Linux (thankfully Notepad2 makes this easy), and the import worked.

PRO IT Service

PRO IT Service on May 13, 2010, 7:33 a.m. Reply

It would have been really nice to have a way to export/import also pages, not only entries.

Exporting pages is possible using Mark Carey’s “Entry to Page Converter” which is available at: http://plugins.movabletype.org/entry-to-page-converter/

Basically, in order to export pages, you would have to first convert them to entries. Make sure to clean up your initial entries, before converting the pages to entries, so that you would ended up with a mix of entries (made of initial entries and pages converted to entries).

If you are not very advanced with these things, you may like to first backup your blog movable type data using backup/restore or directly the mySQL database.

Kind Regards,
Mihai Bocsaru

Daily Movable Type Consultant

Web Development - Movable Type Consulting - Six Apart Partner
http://www.pro-it-service.com/

Movable Type Demo
http://www.movabletypedemo.org/

St Kitts and Nevis economic citizenship program

St Kitts and Nevis economic citizenship program on October 4, 2012, 10:24 p.m. Reply

When I shifted this web page to a new web wide range assistance one of the issues was that the Perl factor for Berkeley DB was not available on the new web wide range web host hosting server. MySQL was available, so I had to company the material of the web site to an itemized released written text pc pc computer file and return them into a lately designed web site on the new web wide range web host hosting server.