Home » Portfolio » MediaWiki to WordPress in 10min

I didn’t have a lot of time to convert my whole wiki to wordpress, so I did a little quick research and came up with this quick perl script.

 

Here is the usage, enjoy  mediawiki2wp

./mediawiki2wp.pl -f <mediaWikiFile.xml> [-o <outputfile>] [-v] [-h] [-V]
-f The XML file that was exported from media wiki

-o Output file to store the wordpress XML in.  If not defined, goes straight to STDOUT

-h This help message-u Base URL

-v Verbose

-V Version

 

 

Before anyone ask, I really don’t plan on making this a larger project, so if you want to take it and run with it enjoy.  Also it doesn’t bring the file attachments over 🙁

 

To use it export all your Mediawiki pages via the special page export.  Place all the pages you plan to export one per line and hit go.

Take that output file run it through the above script, login to your wordpress go to Tools->Import select wordpress Import.  I made the perl script utilize the WordPress WRX format

</Random> is Stephen Fry proof thanks to caching by WP Super Cache