Changeset 1059 for trunk/wp-admin/import-mt.php
- Timestamp:
- 04/11/2004 05:36:45 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import-mt.php
r847 r1059 1 1 <?php 2 2 define('MTEXPORT', ''); 3 4 3 5 if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. You must install WordPress before you import any entries."); 4 6 require('../wp-config.php'); … … 14 16 body { 15 17 font-family: Georgia, "Times New Roman", Times, serif; 16 margin-left: 15%;17 margin-right: 15%;18 margin-left: 20%; 19 margin-right: 20%; 18 20 } 19 21 #logo { … … 42 44 case 0: 43 45 ?> 44 <p>Howdy! We 're about to begin the process to import all of your Movable Type entries into WordPress. It's pretty easy, but it can possible take a little bit of time so be patient. Before we get started, you need to edit this file (<code>import-mt.php</code>) and change one line so we know where to find your MT export file. Look for the line that says:</p>46 <p>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 (<code>import-mt.php</code>) and change one line so we know where to find your MT export file. To make this easy put the import file into the <code>wp-admin</code> directory. Look for the line that says:</p> 45 47 <p><code>define('MTEXPORT', '');</code></p> 46 48 <p>and change it to</p> 47 <p><code>define('MTEXPORT', ' /path/to/your/import.txt');</code></p>49 <p><code>define('MTEXPORT', 'import.txt');</code></p> 48 50 <p>You have to do this manually for security reasons.</p> 49 51 <p>If you've done that and you’re all ready, <a href="import-mt.php?step=1">let's go</a>! 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. :)</p> 50 52 <p>On our test system, importing a blog of 1189 entries and about a thousand comments took 18 seconds. </p> 51 <p>The importer is smart enough not to import duplicates, so you can run this multiple times without worry if for whatever reasonit doesn't finish. </p>53 <p>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. </p> 52 54 <?php 53 55 break; … … 70 72 71 73 // Bring in the data 74 set_magic_quotes_runtime(0); 72 75 $datalines = file(MTEXPORT); // Read the file into an array 73 76 $importdata = implode('', $datalines); // squish it 77 $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata); 78 74 79 $posts = explode("--------", $importdata); 75 80 $i = -1; … … 78 83 ++$i; 79 84 unset($post_categories); 80 $post = preg_replace("/(\r\n|\n|\r)/", "\n", $post);81 85 echo "<li>Importing post... "; 82 86
Note: See TracChangeset
for help on using the changeset viewer.