Learning Movable Type: Moving an Entry from One Blog to Another


For those of you with multiple MT weblogs, have you ever wanted to move an entry from one blog to another? or the entries from only one category from one to another weblog? You can copy the entries from the first weblog and paste them into the second, but how to move the associated comments or trackbacks?

Here's one fairly straightforward method. Note that the categories and subcategories will not transfer over using this method due to limitations of MT.

1. Create a new index template in the weblog that contains the entries you wish to move. Give the template name any name you wish. Call the output file mt.txt. Copy and paste the following code into the new index template:

<MTEntries lastn="1000" sort_order="ascend" category="Your Category Name Goes Here">

AUTHOR: <$MTEntryAuthor$>
TITLE: <$MTEntryTitle$>
STATUS: <$MTEntryStatus$>
ALLOW COMMENTS: <$MTEntryFlag flag="allow_comments"$>
CONVERT BREAKS: <$MTEntryFlag flag="convert_breaks"$>
ALLOW PINGS: <$MTEntryFlag flag="allow_pings"$>
PRIMARY CATEGORY: <$MTEntryCategory$>
<MTEntryCategories>
CATEGORY: <$MTCategoryLabel$>
</MTEntryCategories>
DATE: <$MTEntryDate format="%m/%d/%Y %I:%M:%S %p"$>
-----
BODY:
<$MTEntryBody convert_breaks="0"$>
-----
EXTENDED BODY:
<$MTEntryMore convert_breaks="0"$>
-----
EXCERPT:
<$MTEntryExcerpt no_generate="1" convert_breaks="0"$>
-----
KEYWORDS:
<$MTEntryKeywords$>
-----
<MTComments>
COMMENT:
AUTHOR: <$MTCommentAuthor$>
EMAIL: <$MTCommentEmail$>
IP: <$MTCommentIP$>
URL: <$MTCommentURL$>
DATE: <$MTCommentDate format="%m/%d/%Y %I:%M:%S %p"$>
<$MTCommentBody convert_breaks="0"$>
-----
</MTComments>
<MTPings>
PING:
TITLE: <$MTPingTitle$>
URL: <$MTPingURL$>
IP: <$MTPingIP$>
BLOG NAME: <$MTPingBlogName$>
DATE: <$MTPingDate format="%m/%d/%Y %I:%M:%S %p"$>
<$MTPingExcerpt$>
-----
</MTPings>
--------
</MTEntries>

Change the "Your Category Goes Here" in the first line to the name of the category whose entries you want to move. If you only want to move one entry, create a new category just for that entry and make it the primary category for that entry. If you want to move entries from multiple categories, separate the categories with "OR" like so: category="Category1 OR Category2 OR Category3".

Save and rebuild the template.

2. Using an FTP program, retrieve the mt.txt file you just created from your weblog directory on your server. (You might want to check it in a text editor, to make sure that the data is there.) In the same directory where the mt.cgi file resides, create a new directory called, "import" and place the mt.text file you just created inside.

3. Open up the weblog edit window for the target weblog into which you want the entries moved. At this point it is a good idea to review the importing instructions in the MT Manual. When you are ready, click on the "Import/Export" button on the left side of the edit screen. Then click the "Import Entries" button. When the import is complete, click REBUILD. View your site. Note that unless you set the Default Post Status to "Publish" in your weblog config, all your imported entries will come in as drafts.

4. Remove the mt.txt file from the import folder you created on your server so that if you run the import process again at a later date, the entries you just imported will not be re-imported.

5. Assuming that all has worked and the entries are now in the target weblog, you can delete the entries from the source weblog. In addition to deleting the entries from the weblog edit window, you may also want to delete the files from your server using an FTP program. I tend to keep the files on my server because others may be linking to them and I don't want to create broken links. However, in this case, I close all of the comments and trackbacks of the entries and save the entries before deleting them in the weblog edit window.

Many thanks to Donna of Live in the Delirious Cool for this tip!


Posted by Elise Bauer on October 27, 2004 12:28 AM to Learning Movable Type http://www.learningmovabletype.com/