x
 
Create New Page
 View Previous Changes    ( Last updated by FrankJ )

Export Entries

Question:

How can I export just my entries to an importable format?

Answer:

You can easily use templates to export both your entries and comments into the MT Export Format.

Step 1: Create a new template group called ‘export’ and inside that group create a new template named ‘comments’. In the Preferences, have it set to parse PHP on Input for the ‘comments’ template. Finally, put this in the ‘comments’ template:

<?php 

global $IN
$IN->QSTR '{embed:the_entry_id}' 

?> 

{exp
:comment:entries weblog="default_site" sort="asc"}COMMENT
AUTHOR{name} 
URL
{url} 
DATE
{comment_date format="%m/%d/%Y %h:%i:%s %A"
{comment} 
----- 
{/exp:comment:entries} 

Step 2 In the ‘export’ template group’s ‘index’ template, put this, making sure to change ‘default_site’ to the name of the weblog you want to export:

{exp:weblog:entries weblog="default_site" limit="999" rdf="off"
AUTHOR
{author} 
TITLE
{title} 
STATUS
Publish 
ALLOW COMMENTS

CONVERT BREAKS
br 
{categories}CATEGORY
{category_name} 
{
/categories} 
DATE
{entry_date format='%m/%d/%Y %h:%i:%s %A'
----- 
BODY
{body} 
----- 
EXTENDED BODY
{extended} 
----- 
{embed="export/comments" the_entry_id="{entry_id}"
-------- 
{/exp:weblog:entries} 

Step 3 Click on “View” for the “index” template of the ‘export’ Template Group. It will look awful, so VIEW SOURCE of the outputted template, then do a “File, save as” to save the file so that you can upload it to be imported.

Caveats:

*You can not view export/comments by itself as it will not produce any information unless given a valid entry id from the export/index template.

note:
If you have trouble with the import utility recognizing data from these templates, one thing to try is to make sure that there are carriage returns right after the dashed lines “——-” so that there are no spaces after the dashes.

Category:Exporting

Category:EE1

Categories: