SpareShelf

12 April 2026 · shnele

Getting ten years of photos off phones and into one place

Our photos were spread across four phones, two laptops, a dead tablet and a drawer of memory cards. Everybody was sure the important ones were safe somewhere. Nobody could say where.

Collect everything, change nothing

The first step was to copy every source into its own read-only directory, untouched, and take a checksum manifest. Only then did I start working — on a copy. This cost disk space and saved me twice.

Deduplicate by content

File names are useless here: four phones have each produced an IMG_0001.JPG. Hashing the content collapsed 61,214 files into 38,907 unique ones. Messenger apps re-compress images, so a second pass with a perceptual hash found another four thousand near-duplicates, which I reviewed by hand in batches and kept the larger file from each pair.

Fix the timestamps

Roughly a tenth of the files had no usable capture date — screenshots, forwarded images, scans. For those I fell back, in order, to the date embedded in the file name, then the oldest modification time seen across all copies. Anything still undated went into a folder called unsorted, which I have accepted will exist forever.

library/
  2016/
    2016-07/
      2016-07-23_184502_a3f9.jpg
  ...
  unsorted/

Year, month, and a file name that sorts chronologically and carries a short hash to avoid collisions. No albums in the directory structure — albums live in the gallery software's database, so a photo can belong to several of them without being copied.

Keeping it tidy

Phones now upload on home Wi-Fi to an inbox directory; a nightly job files new arrivals into the layout above. The gallery sits behind a login in the private area of this server, and the whole library is covered by the backups described here.