Monthly Archives: April 2024

Migrating from MediaWiki to Bookstack.

By   April 21, 2024

My long relationship with MediaWiki is over.  It’s been over for a while if I’m honest.

Anyway, there’s no trivial way to import MediaWiki data into Bookstack but here’s what I did:

  1. First I installed Bookstack.
  2. Then export MediaWiki data to xml:

    php maintenance/dumpBackup.php –current –include-files > /tmp/all_pages.xml

  3. Clone https://github.com/outofcontrol/mediawiki-to-gfm

    ./convert.php –filename=/tmp/all_pages.xml –output=/path/to/converted/files

  4. Find where your images went:

    php maintenance/dumpUploads.php

  5. Clone

    https://github.com/Yetangitu/bs

  6. Go to your bookstack implementation and get an API key.
  7. Follow the instructions for ‘bs’ to configure it with your API key.
  8. use ‘bs’ to create books/chapters/pages using the data from step 3.
  9. Upload the images from step 4.
  10. A bunch of manual cleanup and reorganizing.

 

This is not for the faint of heart but it’s also not difficult.  Just a bit tedious.