How to transition from github wiki to mediawiki.
CONVERT FROM GITHUB WIKI TO MEDIAWIKI IN 10 NOT-SO-EASY STEPS!
As with any growing company, it’s important to keep instutitional knowledge and best practices written down and widely available to all.
Since the source code for this site is stored on Github, we originally packaged the documents and knowledge we wanted to share in the Github wiki that came with our repo. This was a good solution at first, but was not scalable to our needs. Github wikis are minimalist and its lack of a search functionality made it useless when working with our large collection of documents.
After experimenting with different wiki packages, we decided to switch to Mediawiki. It had the features we wanted (i.e. search and automatic categorization), and was available through a one-click install through Digital Ocean.
Here’s what we did to move all 51 pages from Github to Mediawiki:
- After Mediawiki was installed on our droplet, we made a backup of our Github wiki by cloning the wiki repo locally. As of this post writing, the Mediawiki version included on the droplet is 1.25, which is not the most current version of Mediawiki. I note this because I downloaded the wrong version of an extension a few times.
- We then added a markdown parser to handle the difference between the default input syntax for Mediawiki, Wiki Markup, and the default for the cloned pages, Markdown. This is one of many Mediawiki extensions available. Adding this parser is a multi-step process, since the Php Markdown Extra library is not packaged with it.
- Once the parser was installed, it was time to lock down the wiki and keep our pages private. These settings had to be modified slightly when the GoogleLogin extension was installed.
- We made our sidebar blocked to anonymous users and added a robots.txt file.
- We didn’t want users to have to remember another password for the wiki, so we decided to add theGoogleLogin extension. The first step was to set up a Google Developers account and add the Google+ API to our wiki application. For the API to work correctly, we needed to set up a domain for our wiki – Google doesn’t like raw IPs. We also used the
allowed domainssetting on the GoogleLogin extension to lock down logins to only allow
- We added content. It was a manual process, done by copying and pasting from a local copy of the Github wiki to the new Mediawiki. Using the categorization syntax, we preserved the old hand-built categories from the Github wiki.
- We increased the upload limit for our file uploads.
- Once the pages were imported and categorized, work was done to customize the sidebar and main page. Mediawiki comes with Special Pages, and the
Special:UncategorizedPagespage was very helpful in catching uncategorized articles, including this un-linked one.
- I’d also like to note that during this process, there was a lot of editing of
LocalSettings.php. Be prepared to get your hands dirty. Syntax higlighting also continues to be a tricky problem. The MarkdownExtraParser extension doesn’t seem to handle blocks of code very well, and the GeSHi syntax higlighting wants to escape
<characters. We’re working on it.
While this process was time consuming, it’s nice to have the most powerful and extendable wiki platform backing our internal knowledge store.