πŸ“Έ Migrating Google Photos to Immich

A step-by-step guide for migrating your personal Google Photos archive (exported via Takeout) to a self-hosted Immich server, preserving photo metadata like EXIF, timestamps, location, and albums.


🧠 Why This Guide?

When exporting photos from Google using Takeout, the result includes:

  • JPEG/HEIC files
  • Companion .json files with metadata (timestamps, location, etc.)
  • Loss of original timestamps if uploading naively

This guide ensures:

  • Original timestamps are restored
  • Metadata is injected into the images before uploading
  • Files are uploaded cleanly to Immich

βœ… Prerequisites

  • Immich server is installed and accessible (with sufficient storage)
  • Python 3.8+ installed on your local machine
  • Google Takeout zip archive already extracted
  • Immich CLI or web UI access

πŸ“ Folder Structure After Extracting Takeout

Takeout/
β”œβ”€β”€ Google Photos/
β”‚   β”œβ”€β”€ IMG_20210101.jpg
β”‚   β”œβ”€β”€ IMG_20210101.json
β”‚   β”œβ”€β”€ Album - Vacation 2021/
β”‚   β”œβ”€β”€ ...

πŸ›  Step 1: Install Dependencies

pip install piexif exifread pillow

πŸ›  Step 2: Restore Timestamps and Metadata

Download restore_metadata.py:

wget https://raw.githubusercontent.com/razzius/google-photos-exif/master/restore_metadata.py

Usage:

python restore_metadata.py /path/to/Google\ Photos
  • The script scans all .json files and updates corresponding images’ EXIF with original photoTakenTime.
  • It also updates file modification timestamps to match EXIF.

πŸ”Ό Step 3: Upload to Immich

Option 1: Web UI

  • Upload directly using browser
  • Immich auto-recognizes EXIF timestamps and organizes photos accordingly

Option 2: Immich CLI

npx @immich/cli upload -h https://your.domain -u your@email.com -p your_password /path/to/processed_photos

Make sure the upload path points to the modified folder that had metadata restored.


πŸ” Optional: Clean Up

  • Remove .json files post-processing (optional):
find . -name "*.json" -type f -delete

πŸ§ͺ Testing

  • Check Immich Library view β€” ensure images show original date/time
  • Inspect individual photo β†’ Metadata tab should reflect expected values

πŸ“ Notes

  • The restore_metadata.py tool can be customized further
  • Always back up originals before processing
  • EXIF editing is destructive (modifies files), so work on a copy

βœ… You’re Done!

Enjoy your fully migrated photo library with original metadata preserved β€” now fully yours on your self-hosted Immich instance.