MediaWiki XML
Filter stream extension to parse a MediaWiki XML package |
Type | JAR |
Category | Filter |
Developed by | |
Active Installs | 67 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Compatibility | Requires XWiki 11.10 or more. |
Table of contents
Description
Filter stream extension to parse a MediaWiki XML package
Supported input
XML export
The Filter take in input an XML file as defined in https://www.mediawiki.org/wiki/Help:Export#Export_format.
Files
The XML file contain the wiki pages, but MediaWiki also store files on the filesystem. You can directly use the folder in which MediaWiki store its files.
Import a MediaWiki export in an XWiki instance
- Install Filter Streams Converter Application
- Install MediaWiki XML
- After you have installed the two extensions, click on the Filter Stream Converter entry from the Applications panel
- Choose the "XWiki instance output stream (xwiki+instance)" output type
- Choose the "MediaWiki XML input stream (mediawiki+xml)" input type
- Indicate in the "Source" field the XML file you exported
- Indicate in the "Files" field the folder containing the MediaWiki files
After you have completed these steps, click the "Convert" button. After that, you will see the conversion progress.
What about the MediaWiki templates ?
Calls to MediaWiki templates are converted into macro calls since that's the closest we can find in the XWiki world, but the implementation of those templates is not converted because it would be very hard (because they are implemented in PHP and often use MediaWiki APIs) so you end up with "Missing macro" error. To resolve them the simplest is to actually implement an XWiki macro which behave like the MediaWiki template you are trying to migrate, see https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingMacros/ for more details on how to implement an XWiki macro.
Advanced use
Import everything in a specific wiki/space
By default, the importer try to convert as much as possible, MediaWiki naming into XWiki naming. That means that all the page located in default MediaWiki namespace will end up in XWiki Main space, for example.
If you make all the imported pages go in a specific wiki or space, you can use the property "Parent". Indicate the reference of the entity. For example for the wiki with the id mywiki use wiki:mywiki and for the space MediaWiki in wiki with id mywiki you can use space:mywiki:MediaWiki. It does not need to already exist.
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).
You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.
Dependencies
Dependencies for this extension (org.xwiki.contrib.mediawiki:mediawiki-xml 2.1.0):
- org.apache.commons:commons-compress 1.19
- commons-codec:commons-codec 1.13
- org.apache.commons:commons-configuration2 2.6
- org.xwiki.commons:xwiki-commons-filter-xml 11.10
- org.xwiki.platform:xwiki-platform-filter-event-model 11.10
- org.xwiki.platform:xwiki-platform-filter-event-user 11.10
- org.xwiki.platform:xwiki-platform-model 11.10
- org.xwiki.contrib.mediawiki:mediawiki-syntax-bliki 2.1.0
- org.xwiki.commons:xwiki-commons-extension-api 11.10
- org.xwiki.rendering:xwiki-rendering-syntax-xwiki21 11.10