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:
- Create a new Index Template in your blog.
- In the Template Name field, type a name of your choosing.
- In the Output File Name field, type a name like
yourcategory.txt. - Paste the contents of the export format file into the Template Body window.
- Surround the code you've just added with MTEntries tags:
replacing<MTEntries category="yourcatname">
...
</MTEntries>yourcatnamewith the category name you wish to export. - Save your changes.
- Rebuild the template to generate the export file on your server.
Further ideas
To export a single entry:
- Download and install the Entry plugin.
- Follow the steps above for the category export, and for step 5, use this code:
replacing<MTEntry id="118">
...
</MTEntry>118with the ID of the entry you wish to export.
To export by month:
- Create a new Archive Template in your blog.
- In the Template Name field, type a name of your choosing, such as
Monthly Export. - Paste the content of the export file into the Template Body window.
- Surround the code you've just added with MTEntries tags:
<MTEntries>
...
</MTEntries> - Save your changes.
- Go to Weblog Configuration > Archive Files.
- 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.
- Your new template will now be listed in the Archives section of the screen next to the Monthly Archive Type.
- In the Archive File Template box next to your new template, enter the following:
exports/<MTArchiveDate format="%m%Y">.txt - Save your changes.
- Rebuild your Monthly Archives to generate the export files on your server.
- 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.


