One of the capabilities I need in Movable Type is the ability to clone certain features, such as categories, for use across multiple sites. After much discussion on the MT Dev mailing list I've come up with a simple and fast interim solution for the challenge of moving (cloning) the categories from one blog to another.
The technique combines the ability to use Movable Type's versatile Index Templates to generate a text file with the MT Import/Export processes. Movable Type's Import process handles all the dirty work of category creation for you - you just have to delete the single blog entry that the import process creates.
Here is the step by step detail of the process.
1) Create the export file. On the blog that contains the categories you'd like to clone, create a new Index Template and give it an output file name of something like export.txt.
Use the following code for the new template:
- TITLE: A dummy title
AUTHOR: Author
DATE: 02/10/2006 03:31:05 PM
<MTCategories show_empty="1">
CATEGORY: <$MTCategoryLabel$>
</MTCategories>-----
BODY:
This is the body.
-----
3) Download the file to your hard disk.
4) On the blog you want to receive the cloned categories, upload the export.txt file to the import directory under your MT system directory - where your MT.CGI file lives. It's possible that you might need to create the import directory, if it doesn't exist. MT's Import function looks for files in that directory to run the import process/
5) Go to the import screen and choose to import. You can leave all of the choices at their default values, except the "Import entries as me" checkbox, which you should select. Click Import Entries to begin the process.
6) Delete the single blog entry that is created by the import process.
7) You're done!
All of the categories in the export.txt file will be created for you.
The only downside to this procedure is that any top level/subcategory relationships are lost since everything is imported as a top level category. The upside is that's it's very easy and can be done right in the MT admin interface.








