{"id":1701,"date":"2004-09-22T07:39:06","date_gmt":"2004-09-22T11:39:06","guid":{"rendered":"http:\/\/scruss.com\/blog\/?p=1701"},"modified":"2007-03-16T07:45:47","modified_gmt":"2007-03-16T11:45:47","slug":"reindexing-old-mt-entries","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2004\/09\/22\/reindexing-old-mt-entries\/","title":{"rendered":"Reindexing old MT entries"},"content":{"rendered":"<p>I&#8217;m not quite there yet, but I&#8217;ve got all my old MT articles with the same IDs as they had under that CMS.  I basically used <a href=\"http:\/\/drbacchus.com\/wordpress\/index.php?p=611\">DrBacchus&#8217; More about migrating from MT to WP<\/a> method, but tried to integrate <a href=\"http:\/\/www.papascott.de\/archives\/2004\/09\/01\/export-from-wordpress\/\">Scott Hanson&#8217;s Export from WordPress<\/a>. It was not a complete success, but I&#8217;ll document what I did here in the hope that it&#8217;s useful.<\/p>\n<p><a href=\"http:\/\/drbacchus.com\/\">DrBacchus<\/a> was using an older version of MT, while I&#8217;m using the most recent version. I found that the file you have to edit to insert IDs is <code>lib\/MT\/ImportExport.pm<\/code> &#8212; not <code>lib\/MT\/App\/CMS.pm<\/code>.<\/p>\n<p>If you can avoid the temptation of adding blog entries to WP before importing from MT, do so. It&#8217;s a royal pain to add them later.<\/p>\n<p>I used the WP MT-export module to export all my blog entries, then trimmed out the existing entries which had been entered in MT. I then added entry IDs to the export file (an awk one-liner: <code>awk 'BEGIN{id=323;} {print;} \/^STATUS: \/ {print \"ID:\", id; id++;}'<\/code> worked for me, as my highest MT article ID was 322).  I then joined the export files from MT and WP in one big &#8216;export.txt&#8217; file.<\/p>\n<p>If you have existing WP entries, you&#8217;ll have to get rid of them. I found that going directly into the database, and doing:<\/p>\n<p><code>delete from wp_posts;<br \/>\ndelete from wp_comments;<\/code><\/p>\n<p>would do it.<\/p>\n<p>Don&#8217;t forget to patch <code>import-mt.php<\/code> as per DrB&#8217;s instructions before importing.<\/p>\n<p>Here&#8217;s where the pain comes in \u00e2\u20ac\u201d WP wouldn&#8217;t import the text from the entries created in MT. It restored all the metadata, but not the content. So I had to manually patch in the entries from the export file.<\/p>\n<p>I still have to work out rewrite rules for permalinks, but at least everything&#8217;s on the server where it should be. Maybe <a href=\"http:\/\/weblog.bluedonkey.org\/index.php?p=137\">John&#8217;s Moved To WordPress rewrite rules <\/a>will help me, as I think that my host (<a href=\"http:\/\/1and1.com\/\">1and1<\/a>) may not be doing entirely halal things with <code>.htaccess<\/code> support.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m not quite there yet, but I&#8217;ve got all my old MT articles with the same IDs as they had under that CMS. I basically used DrBacchus&#8217; More about migrating from MT to WP method, but tried to integrate Scott Hanson&#8217;s Export from WordPress. It was not a complete success, but I&#8217;ll document what I [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[1805,163,49],"class_list":["post-1701","post","type-post","status-publish","format-standard","hentry","category-general","tag-admin","tag-movable-type","tag-wordpress"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-rr","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/1701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=1701"}],"version-history":[{"count":0,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/1701\/revisions"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=1701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=1701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=1701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}