For our wiki system we used to use sakana. In the process of migrating to a new server machine I also wanted to take the time to change wiki systems (as Sakana is no longer in active development).
Well, great, I thought. I’ll just use that and everything will be fine. In theory. In theory.
Here are my steps to importing sakana into Moin.
- Install MoinMoin
- Run sakana2moin.py. Do Not just put the output into the /data/text folder. Just keep it in some temp folder.
- In your Python site-packages folder is a script/import folder. cd into it
- In here is irclog.py. Meant to import IRC logs (whodathunkit?) it works OK for our purposes too. Open this file in your favorite text editor
- irclog.py will import all but the last file into Moin (thinking that the last file is the one still recording IRC logs). Not so in our case, so modify line 59 (for filename in files[:-1]:) to just for filename in files:. Now we’re importing all the files.
- irclog.py also assumes we’re pouring in plain text format into Moin. Except the Sakana converter is smarter than that, and gives us markup in Moin style wiki format. Line 67 tells Moin what kind of data we have. Change #format text to #format wiki Run irclog.py (instructions are at the top of the file). This might take a while (my smallish wiki took 2-3 minutes).
- The only bad thing about this method is that the page names get confused. Any page name that would need to be URL encoded gets mangled. “A Pretty Page” gets turned into “A(20)Pretty(20)Page”. Ok, except Moin expects it in “A%20Pretty%20Page” format. I haven’t taken the effort to dive into the sakana2moin.py script to fix this issue (my wiki is small enough that it’s possible to do it by hand).
That’s it. It took a long while to figure out, but we finally got it done. Hope this helps someone else.