Migration of MediaWiki to GitLab Wiki
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:
php convert.php --filename=<xml-export> --output=<Pfad zum Exportordner> --format=markdown |
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:
- The site MainPage.md has to be renamed to Home.md
Links have to be changed to the following syntax:
[link text](page title)
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:
git@git.rwth-aachen.de:<username>/<Projektname>.wiki.git |
The pages have to be copied there, afterwards the directory has to be pushed to Gitlab again