Skip to main content

Migrating Moniwiki to MoinMoin

I had been using Moniwiki for our company for a while because the installation was quite easy as it was PHP based. However, I found out that document versioning didn't really work. It may have been a configuration issue but I took this opportunity to take a look at MoinMoin, as it was being used by Ubuntu and looked well supported.

The server was running Debian stable and MoinMoin was in the repositories. Installing was simple using aptitude. Configuration was a bit more involved as it required copying and editing files.

The new wiki site was pleasantly more responsive. The next task was to move the data in Moniwiki to MoinMoin. Upon inspecting the data repositories, I realized that Moniwiki stored the data in individual files with the WikiWord as the filename while MoinMoin organized that data with the WikiWord as a directory with the actual content under the revisions directory. I cooked up a quick script to migrate the data. I also ran the previous file through a 'tr' to filter out non ascii characters, which was present in Moniwiki and showed up as errors in MoinMoin.

The next problem was the way non WikiWord links were defined. In Moniwiki these are written as [Link to Text] while MoinMoin used ["Link to Text"]. I had a couple of those so I simply edited them to the MoinMoin syntax. It turned out to have another problem as Moniwiki saved it as a file named LinkToText while MoinMoin stored is as Link_to_Text. I simply renamed those links and MoinMoin powers the wiki now.


#!/bin/sh

SRC=/usr/share/moniwiki/data/text
DEST=/var/www/moinwiki

PAGES=`ls $SRC`
cd $DEST

for i in $PAGES; do
mkdir -p $i/revisions
echo "00000001" > $i/current
#cp $SRC/$i $i/revisions/00000001
tr -cd '\11\12\13\40-\176' < $SRC/$i > $i/revisions/00000001
done

Comments

Popular posts from this blog

Your car key remote got wet, what now?

My car key fell into a street drain where it lay there for at least 5 minutes before somebody was able to fish it out. The first thing you need to do is remove the battery and dry out the electronic parts. I used tissue paper to blot out all visible moisture. When everything appeared to be dry, assembled the key back and tried to open the car. Fortunately, it worked. A couple of hours later, it didn't work anymore. When I checked the battery again, there was a little water and it appeared that there was still moisture inside the casing. The best thing to do here is to find silica gel or a dessicant which you can find inside new shoes or bags. If you can't find any, you can go to a supermarket and buy a pack of rice crackers. I knew One One Rice Crackers had a large pack of dessicant inside. That's the one on the left below. I found the one on the right from a Case Logic bag. Just pack these together with the electronic component of the car key in plastic bag. Seal it and

Get uptime alerts in Telegram

You will be configuring 3 services. The assumption is that you have accounts already for these services. UptimeRobot — source of the uptime/downtime notifications. It currently supports email, Twitter, Slack, Pushover, Pushbullet and others but not Telegram. We will use the webhook notification as the way to send messages to Telegram. IFTTT — bridges UptimeRobot and Telegram by providing the webhook for UptimeRobot and triggering a message to Telegram. In IFTTT terminology: IF {event trigger from UptimeRobot}, then {send message to Telegram group} Telegram — destination of the notification. You will need to create a group for this. Telegram Configuration In Telegram, create a new group, if needed. You may opt to use an existing group. Go to @IFTTT and follow the instruction so link your Telegram account to your IFTTT account. Send /connect_group to @IFTTT and connect the group where you want to send the notifications. IFTTT Configuration Sign in to IFTTT and add a ne

iReport Default Date Parameter

If you want to set a default date for a jasperreports parameter, you can enter the following in the default value expression of the parameter. new Date() However, if you wanted the default to be relative from today, for example, 3 days ago, you will need to do go outside of the standard java date libraries (Date, Calendar) because JR parameter does not allow you to have multiple statements. You can write your own utility package or you can use Joda , a replacement library for the JDK date and time library. To use Joda in iReports, you need to extract the jar file and add it to Options -> Classpath. You may also drop the jar file in iReports' lib directory. You will also need to add this library to your application or report server. For setting a default date 5 days prior from today, use this: new org.joda.time.DateTime().minusDays(5).toDate() or this if you want the time part set to the beginning of the day: new org.joda.time.LocalDate().toDateTimeAtStartOfDay().minusDays(5).to