Generating an XML Export in MediaWiki

First an XML export including all sites of a MediaWiki has to be generated, to accomplish this is a bit difficult (there is no button to do it automagically). Please refer to https://www.mediawiki.org/wiki/Help:Export/en.

Converting an XML Export to Gitlab Markdown pages

The following tool can be used for converting MediaWiki XML exports to Gitlab Markdown pages: https://github.com/philipashlock/mediawiki-to-markdown

On that page the usage of the tool is documented. To continue, Linux is needed, for Windows the tool would need to be patched (refer to Github issue 5). After the installation as described in the linked documentation the conversion has to be done as follows:

Modifications for Gitlab Wiki

After the conversion there are as many *.md-files as exported pages. To be able to see these pages in Gitlab, the following modifications have to be done:

  1. The site MainPage.md has to be renamed to Home.md
  2. Links have to be changed to the following syntax:

Pushing completed pages to Gitlab

To push the completed pages to Gitlab, the repo holding the wiki of the project has to be cloned locally, the URL looks like this:

The pages have to be copied there, afterwards the directory has to be pushed to Gitlab again.