Move a DokuWiki namespace to a different wiki

I started using DokuWiki a few years ago, and didn’t think very correctly about how to organise the page and media hierarchies. Now I know more about what I want in wiki.samwilson.id.au and how I need to be able to give people access to it, I’ve decided to reorganise the whole thing. Namespaces shall now be used for access control, not topics. The problem with this change is that there would be a pile of namespaces that would no longer exist but which would still need to be protected (or have their revision history removed). Most of their content isn’t going to remain on the site (thanks to a pile of family history stuff being moved into Webtrees at cfbarker.archives.org.au) and so it seemed easier to start with a clean slate and move only selected bits to it. Hence, how to move a namespace into another wiki:

  1. Copy the data/{attic,media,media_attic,media_meta,meta,pages}/nsname directories from the old wiki’s data directory to that of the new.
  2. Clear the new wiki’s cache.
  3. Run php bin/indexer.php.
  4. Browse the new wiki and check that all is okay.

Easy, really.

Rename and move images according to date

My simple import-images.sh script that I use to shift files into my (ownCloud-backed) archiving system:

#!/bin/bash

if [ ! -d "$1" ]; then
  echo "Error: first parameter must be a directory" >&2
  echo "Usage: "$(basename $0)" "
  echo "       where  is an existing directory from which to import images"
  exit 1
fi

DEST=$HOME/photos
exiftool '-FileName