'; echo '

' . __('Import Movable Type') . '

'; } function footer() { echo ''; } function greet() { $this->header(); ?>

Howdy! We’re about to begin the process to import all of your Movable Type entries into WordPress. Before we get started, you need to edit this file (import/mt.php) and change one line so we know where to find your MT export file. To make this easy put the import file into the wp-admin/import directory. Look for the line that says:

define('MTEXPORT', '');

and change it to

define('MTEXPORT', 'import.txt');

You have to do this manually for security reasons.

If you've done that and you’re all ready, let's go! Remember that the import process may take a minute or so if you have a large number of entries and comments. Think of all the rebuilding time you'll be saving once it's done. :)

The importer is smart enough not to import duplicates, so you can run this multiple times without worry if—for whatever reason—it doesn't finish. If you get an out of memory error try splitting up the import file into pieces.

footer(); } function get_entries() { set_magic_quotes_runtime(0); $importdata = file(MTEXPORT); // Read the file into an array $importdata = implode('', $importdata); // squish it $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata); $importdata = preg_replace("/\n--------\n/", "--MT-ENTRY--\n", $importdata); $this->posts = explode("--MT-ENTRY--", $importdata); unset($importdata); } function import() { if ('' != MTEXPORT && !file_exists(MTEXPORT)) die("The file you specified does not seem to exist. Please check the path you've given."); if ('' == MTEXPORT) die("You must edit the MTEXPORT line as described on the previous page to continue."); $this->get_entries(); } function dispatch() { if (empty($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; switch ($step) { case 0: $this->greet(); break; case 1: $this->import(); break; } } function MT_Import() { // Nothing. } } $mt_import = new MT_Import(); register_importer('mt', 'Movable Type', 'Import posts and comments from your Movable Type blog', array($mt_import, 'dispatch')); ?>