Tuesday, January 5, 2010

Migrating from MoinMoin to MediaWiki

Due to popular demand, i recently had to migrate from MoinMoin to MediaWiki. Urgh!! Lots of work - formatting, uploading, versions etc. Luckily, some folks at w3c have gone through this before and created a nice little script that takes care of all this :)
Here goes my session

$ perl mm2mw.pl home/wiki/techwiki
mmTOmw : Copyright (c) Rotan Hanrahan 2007,2008.
This is free software under the W3C License. See source for details.
http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
src = home/wiki/techwiki/data
dst = home/wiki/techwiki-mw
URL = http://test.example.com/mediawiki/index.php
mmURL = http://www.w3.org/YYYY/GroupName/wiki/
Split = 1000000
Type '?' for help
mmTOmw>
mmTOmw> analyse
src = home/wiki/techwiki/data
dst = home/wiki/techwiki-mw
URL = http://test.example.com/mediawiki/index.php
mmURL = http://www.w3.org/YYYY/GroupName/wiki/
Split = 1000000
Analysis:
53 wiki pages to be ported.
0 wiki pages are deleted and not to be ported.
271 revisions in total to be ported.
8 attachments to be ported.
0 users recorded in the moinmoin logs.
mmTOmw> convert
Generated 1V0Z33J
Generated 4SL341J
Generated .....
.....
Generated xenServerPrototypePage
Conversion complete.
Convertion took 2 seconds.



Quit and have a look at the files created (Interactive upload failed for me :( )

$ cat home/wiki/techwiki-mw/instructions.txt
# To upload the XML files to MediaWiki, log in as Sysop and go to 'Special:Import' page.


Pages for importing to the target MediaWiki server are:
1V0Z33J
4SL341J
.....

Navigating to MediaWiki's special:Import page and uploading the xml works like a charm.
Beautiful!


No comments:

Post a Comment