Powered by WikiRing Consultants |
This is a commandline tool to import MediaWiki pages and images to Foswiki. It processes a MediaWiki XML dump to extract the pages and thus does not need a database access once the dump was created.
The conversion tool takes care of almost all peculiarities of MediaWiki and Foswiki. It does not map MediaWiki's category system onto Foswiki as long as Foswiki lacks a standard category system. There are however many ways to implement categories in Foswiki, one of which is the upcomming ClassificationPlugin which implements true hierarchies and semantic predicates to query categories and topics within. The mediawiki2foswiki tool allows to map the MediaWiki categories onto any Foswiki category system like the mentioned one using a plugin interface that comes with the conversion tool. One notion of caution: in general the conversion tool is able to convert the wiki markup dialects. However, the MediaWiki's template mechanism, comparable to Foswiki's parametrizedINCLUDE
statement does
not match. The reason is burried in the different parsing priorities
within both parsers: while MediaWiki parses left-to-right, Foswiki
does also parser inside-out, which means parameters to INCLUDE
are
evaluate before making the inclusion. The opposite is the case
in MediaWiki. In a way MediaWiki's tempaltes are called
"by reference" (passing the unparsed parameters) while Foswiki evaluates
INCLUDE
passing parameters "by value". This means, that WikiApplications
written for MediaWiki won't be translatable to WikiApplications
easily by this tool.
<path-to-your-foswiki>/tools/mediawiki2foswiki
.
mediawiki2foswiki --file <dumpfile> [--<debug>] [--<defaultweb> <webname>] [--<dry>] [--<exclude> <regex>] [--<help>] [--<images> <path>] [--<include> <regex>] [--<language> <language code>] [--<match> <regex>] [--<max> <number>] [--<namespace> <name>] [--<plugin> <perlfile>] [--<topicmap> <fromTopic1=toTopic1,fromTopic2=toTopic2,...>] [--<web> <target web>] [--<webmap> <fromWeb1=toWeb1,fromWeb2=toWeb2,...>
mediawiki2foswiki --file dump.xml --web MediaWiki --language de --topicmap 'Hauptseite=WebHome,Spezial.Allpages=WebTopicList' --images /var/www/mediawiki/images --defaultweb _mediawiki_default --plugin MyConversionPlugin --exclude '^(MediaWiki|Bild|Kategorie):'This reads the file
dump.xml
, and creats a web called MediaWiki in our
current installation (see Setup). In this example, the source content is German.
The pages "Hauptseite" will be stored in the the WebHome
topic. The
Special.Allpages
page will be stored in WebTopicList"
. Images are taken from
the images subdirectory of our MediaWiki installation at /var/www/mediawiki
.
We prepared a template web called _mediawiki_defaul
that will be used when
creating webs. We have some perl code in MyConversionPlugin.pm
that
defines some custom conversions only of relevance for our own content. Source
pages that match the regular expression MediaWiki|Bild|Kategorie
will be
excluded from the translation process.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available inconfigure
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Author: | Michael Daum |
Copyright ©: | 2006-2009, Michael Daum http://michaeldaumconsulting.com |
License: | GPL (GNU General Public License) |
Release: | v2.0 |
Version: | 2536 (2009-02-19) |
Change History: | |
19 Feb 2009 | converted to foswiki extension |
20 Jul 2007 | initial release |
Dependencies: | None |
Contrib Home: | Foswiki:Extensions/MediaWikiToFoswikiContrib |