Mediawiki Conversion

This page describes how to transfer Mediawiki content to Git, preserving full history complete with renames. It also shows how to purge spam and other unwanted edits in the process.

Quick Links: Git Load

Introduction

The procedure described here moves the files into Git but it does not convert the Mediawiki markup or change the content of the edits at all. You can do one of two things to fix this:

Finially, you might want to scan over the TODO list at the bottom of the page. There are a few features that we don't support yet. Patches welcome!

Edit Courageously

Thes pages are just some coarse notes that I took while going through this process myself. I'm sure they're crap. Please edit these pages directly to ask questions, make comments, clarify things, whatever.

Prerequisites

We'll use:

On Debian / Ubuntu:

   $ sudo apt-get install ruby libxml-ruby xsltproc

If you want to display Mediawiki markup in Ikiwiki, you should install the Mediawiki Plugin before following these instructions and make sure it works to your satisfaction.

Mark Existing Wiki Read-Only

First mark your Mediawiki read-only so nobody loses edits into an obsolete wiki.

    http://wiki.u32.net/index.php?title=Mediawiki:Sitenotice&action=edit

The Process

If you have a small site and don't want to perform any despamming, you should be able to do the conversion in 20 minutes to an hour. If you have a large site with a lot of spam, despamming can take hours or even days. Definitely comment anywhere the procedure isn't clear.

Follow these steps in order.

  1. Export -- Ask Mediawiki to produce all edits in hundred-megabyte XML files.
  2. Translate -- Convert page moves, namespaces, etc from Mediawiki conventions to Git/Ikiwiki.
  3. Despam -- (optional) Delete all history that you don't care to preserve.
  4. Import -- Sort, reformat, and import into your Git repository.

The Files

Remember that these scripts were written as one-time hacks! They are uuuugly. Well, only iki-fast-load is really ugly, the rest are just expedient.

Thanks

Special thanks to Loye Young who reverted spam off my old wiki a whole bunch of times.

TODO

comments

> I'd like to pull together some docs on ikiwiki.info about conversions.. could I copy this page to there? --?Joey