Backing up (my) Commons files

I’m experimenting with an idea of treating the Commons copies of my photos as the ‘master’ copy, and not keeping them online anywhere else (e.g. Flickr). This involves uploading to Commons and then keeping a local copy in sync — because I don’t want to lose any photos if they get deleted from Commons.

I’m using Digikam locally, and have two collections configured: one scratch-pad one, for sorting out photos that are just off the camera; and one backup one, which lets me browse photos I’ve got on Commons.

I download from Commons with the following script, which goes through all of my contributions and exports XML for every page I’ve worked on, and every file for which I’m the first author (i.e. I uploaded it).

BACKUP_DIR=$(cd "$(dirname $0)"; pwd -P)
mwcli export:contribs \
	--config="$BACKUP_DIR/config.yml" \
	--wiki=commons \
	--user=samwilson \
	--dest="$BACKUP_DIR" \

The mwcli script is at

The reason I want the Commons copy to be canonical is that it makes for centralised metadata, a single place to edit and add links to related material. It’s annoying to have to keep metadata in sync between Commons, Flickr, and possibly a local copy of things too.

Putting photos in folders

I’m printing index sheets for the FSPS photos, so that each streets’ group of photos (e.g. Ainslie Road) in the archive folders is divided by a set of A4 colour-printed pages with thumbnails of the photos. These don’t actually have each photo’s URLs or filenames, which I’ve been a bit disappointed about, but it does have the URL of the street’s page. That is enough to get pretty close to an individual photo, and I think it’s good enough. If I were starting this project again I might do things a bit differently, but I’m far enough in now to want to maintain consistency.

I do want to sort out a better URL rewrite for page IDs. At the moment I am including page ID URLs such as but this would be neater as (which would prohibit having wiki pages at that URL, but I think that’s okay).

Fremantle Bowling Club

Fatal error: Uncaught Exception: Unable to retrieve URL: in /var/www/ Stack trace: #0 /var/www/ embed_wikimedia_get_data('https://tools.w...', 'xml') #1 /var/www/ embed_wikimedia_commons(Array, Array, 'https://commons...', Array) #2 /var/www/ WP_Embed->shortcode(Array, 'https://commons...') #3 [internal function]: WP_Embed->autoembed_callback(Array) #4 /var/www/ preg_replace_callback('|^(\\s*)(https?:...', Array, 'I tried to writ...') #5 /var/www/ WP_Embed->autoembed('I tried to writ...') #6 /var/www/ WP_Hook->apply_fi in /var/www/ on line 115