Trac to MoinMoin Converter

Edit: I've since discovered a script with the exact same name, from 2007 but that also transfers attachments: Trac2Moin

Note: Colin Guthrie wrote a more extensive script to do this job as part of a conversion of PulseAudio wiki from a Trac instance to FreeDesktop.org. The script will convert content, history and attachments. It can rename wiki pages during the conversion (fixing links in content too), and rename users too. It can also fix up some wiki syntax too (either inline on every change, or once at the end).

trac2moin.sh

This script will use a Trac wiki text file dump to create a subdirectory called MoinMoin, with MoinMoin file structure created for each file. One way to create such a Trac wiki dump (works with Trac version 0.10.4 - old I know, sorry) is with the following (exact location of your files may vary by distribution):

Note that this script will only create the proper file structure. It will *not* correct the differences in wiki markup - the most important of these being links. Likewise, note that attachments will not be automatically transferred.

After it completes, everything will be in your Trac dump directory in a subdirectory called MoinMoin. Copy (as root) the contents of this subdirectory into /usr/share/moin/yourwikiname/data/pages/ (location may vary depending on your distribution) and make sure the owner and group are still 'www-data' (or whatever username your apache server is using). If not, this can be changed by changing directory to your 'pages' directory and typing (as root):

(!) If you enhance this script, please attach it to this page. Thanks!

moin 1.7.1

This is a rough start, but better than nothing. If you want to use this, you'll need to adapt paths etc. because locations vary by distribution. Improvements welcome.

To-Do's

MoinMoin: Trac2Moin (last edited 2012-03-07 09:15:35 by 5e0e47ac)