Backing up my flickr photos and metadata
I’ve been trying to backup my flickr account for long time and haven’t (until now) found a good solution. I want to backup not only the original photos but the titles, descriptions, comments, geotags, etc. There are several programs that will run MacOSX / Linux for backing up just the photo files, but most (or all) of these don’t backup metadata or else they are really difficult to get running under OSX.
Today I found Offlickr.py, a python script that uses the python flickrapi module and libxml2 to do exactly what I want. Getting all this to work on Mac OSX 10.6 (Snow Leopard) took some searching and compiling so I wanted to record what I did here.
Steps:
- Download Offlickr.py and libxml2 source, put them in directory [DIR] (I downloaded ftp://xmlsoft.org/libxml2/libxml2-2.7.6.tar.gz
- Compile libxml2: untar the libxml archive and enter it’s directory:
tar xvzf libxml2-2.7.6.tar.gz; cd libxml2-2.7.6
and compile:./configure; make; sudo make install - Before you run Offlickr.py you’ll have to make sure Python knows where to find the libxml2 module. Mine got installed in /usr/local/lib/python2.6/site-packages so I put this directory in my python path:
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.6/site-packages - Go back to [DIR]:
cd .. - Before running Offlickr.py you may need to make a modification. I had to do this to avoid getting the error:
UnboundLocalError: local variable 'isPrivateFailure' referenced before assignment
What I did (following this Google code issue) is modify line 390, by inserting the line:isPrivateFailure = Falsemake sure the line is properly indented so that Python doesn’t complain.
- Now we’re ready to rock and roll. Find your flickr ID (e.g. mine is 97495157@N00) and run:
mkdir BACKUP ./Offlickr.py -i 97495157@N00 -d BACKUP -p
See the Offlickr.py page above for more commandline options.
Now I have a nice DVD backup of my 2250 flickr photos, complete with metadata! Awesome.


