Migrating wiki content

I’ve used DokuWiki for several years now and appreciated the ease of installation and use, the speed, but I never truly felt comfortable with the wiki requiring write access to its directory structure to store its versioning information. That and moving/deleting the pages seemed required command-line access. While I was mostly ok doing that myself, I couldn’t expect contributors to be comfortable doing so.

It served its purpose though, and for that I’m grateful. Of course to be fair, I’m also moving away from it because I use MediaWiki at work and am wanting to standardize on that.

So, I’ve been migrating content from the old wiki to the new one and it’s been going pretty well so far. The new wiki isn’t running as fast as I’d like, but I blame the current server configuration for that. While I work on moving the last handful of pages, I’m redirecting old content to the new system so any existing search engine traffic will find their way to the right pages.

For someone that previously had no experience installing/configuring MediaWiki it really wasn’t that bad. I’m also new to using Git, so installing MediaWiki using Git was a good excuse to expose myself to it again. While I still prefer Subversion for all of my work, I need to get used to it for other projects I plan to interact with.

Note to self:

I started the installation on July 4th and wrapped up basic configuration on the 7th while migrating content is still an ongoing process. I hope to wrap up by this Saturday.

Commit blocked by pre-commit hook (exit code 255) with no output.

That’s what is seen client-side, and this is what is seen server-side:

Revprop change blocked by pre-revprop-change hook (exit code 255) with no output. [500, #165001]

In most cases the usual search results will point you where you need:

  • execute permission not set on the hook script
  • missing hook script allowing property change
  • wrong line endings

In my case:

I recently moved the repositories off of a smaller file system to a larger one that had noexec set. Spent an hour+ trying to figure it out and it took a combination of this error message:

# ./test.sh
-bash: ./test.sh: Permission denied

and remembering that I had run into this in the past before it dawned on me.

Figures.

SVN rename *.{{} to *.{}

I imported files into a repo that were supposed to end with the .{} extension, not .{{} as they ended up having.

I could have used a shell script to accomplish this, but I’m forcing myself to do this with Python and relearn a lot of things I’ve forgotten in the last year or so. I placed the following in a file named fix.py and dropped it into the directory of files I wanted to rename. It was a shallow directory, so I didn’t have to recursively rename files.

import os
import glob

files_to_fix = glob.glob('*.{{}')

for file in files_to_fix:
    command = "svn mv %s %s" % (file, file.replace("{{}","{}"))
    os.system(command)

The command basically comes down to:

svn mv file.{{} file.{}

Update:

Instead of:

    command = "svn mv %s %s" % (file, file.replace("{{}","{}"))

I used:

    command = """svn mv "%s" "%s" """ % (file, file.replace("{{}","{}"))

This was to catch file names that had spaces in them.