The Movable Type Knowledge Base

Customized Exports

Question

I'm having trouble getting a full export of my entries using the default export function. Are there other ways I can perform an export?

Answer

Movable Type contains a function to export all of the entries in your blog, but that doesn't mean your options stop there. You can easily export a single entry, all entries from one or more categories, or break your exports down by month (helpful for those with large blogs whose server times out on the export).

The secret is in this export format file. By downloading this file and pasting it into a new template, you can harness the power of the export function to meet your particular needs.

Basic Example

To export all entries from a single category:

  1. Create a new Index Template in your blog.
  2. In the Template Name field, type a name of your choosing.
  3. In the Output File Name field, type a name like yourcategory.txt.
  4. Paste the contents of the export format file into the Template Body window.
  5. Surround the code you've just added with MTEntries tags:
    <MTEntries category="yourcatname">
    ...
    </MTEntries>
    replacing yourcatname with the category name you wish to export.
  6. Save your changes.
  7. Rebuild the template to generate the export file on your server.

Further ideas

To export a single entry:

  1. Download and install the Entry plugin.
  2. Follow the steps above for the category export, and for step 5, use this code:
    <MTEntry id="118">
    ...
    </MTEntry>
    replacing 118 with the ID of the entry you wish to export.

To export by month:

  1. Create a new Archive Template in your blog.
  2. In the Template Name field, type a name of your choosing, such as Monthly Export.
  3. Paste the content of the export file into the Template Body window.
  4. Surround the code you've just added with MTEntries tags:
    <MTEntries>
    ...
    </MTEntries>
  5. Save your changes.
  6. Go to Weblog Configuration > Archive Files.
  7. Under Create A New Template/Archive Type Association, select "Monthly" in the Archive Type drop-down menu; and select the new template you just created in the Template drop-down menu. Then click the ADD button.
  8. Your new template will now be listed in the Archives section of the screen next to the Monthly Archive Type.
  9. In the Archive File Template box next to your new template, enter the following:
    exports/<MTArchiveDate format="%m%Y">.txt
  10. Save your changes.
  11. Rebuild your Monthly Archives to generate the export files on your server.
  12. Each file will be located in your Local Archive Path, under exports/MMYY.txt.

Note: The options described in this tutorial will only export entries with a status of PUBLISH. Entries with a status of DRAFT or FUTURE will not be included in your customized export files.

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or questions. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Yahoo! Small Business web hosting services

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.