]> sipb.mit.edu Git - ikiwiki.git/blob - doc/tips/Movable_Type_to_ikiwiki.mdwn
ikiwiki (3.20140916) unstable; urgency=low
[ikiwiki.git] / doc / tips / Movable_Type_to_ikiwiki.mdwn
1 this script can be used to convert your existing Movable Type blog/database to a ikiwiki blog.
2
3 First, go to your MT Admin panel and purge all spam comments/trackbacks. Then use this script: <http://anti.teamidiot.de/static/nei/*/Code/MovableType/mtdump_to_iki.pl>
4
5 If you wrote your posts with markdown already you're pretty much ikiwiki compatible :-)
6
7     DATABASE_NAME=your_mt_database
8     DATABASE_USER=your_mysql_user
9
10     mkdir -p conv/posts
11
12     mysqldump $DATABASE_NAME -v -nt --compatible=ansi,postgresql \\
13       --complete-insert=TRUE --extended-insert=FALSE --compact   \\
14       --default-character-set=UTF8 -u $DATABASE_USER             \\
15     | perl mtdump_to_iki.pl
16
17 the script will spit out one file for every post into the conv/posts directory. you can manually clean them up or however you like. next, you must set the output directory where your ikiwiki resides:
18
19     export OUT=$HOME/my_ikiwiki_blog
20
21 make sure there is a 'posts' subdirectory inside (default if you start with the blog-setup script)
22
23 now you can import one or all posts and comments by running the post file through zsh:
24
25     zsh ./1__my_first_post.mdwn
26
27 or to do it all:
28
29     zsh
30     for import (<->__*.*) { zsh $import }
31
32 the files will be created in your $OUT directory and committed onto git. now the **important** last step: run
33
34     ikiwiki --gettime --setup your.setup
35
36 only with the gettime flag will ikiwiki reread the file dates as recorded in the git. Enjoy!
37