Google photo migration to Immich
Since I've been migrating from Big Tech to more self-hosted one of the things I've been putting off was migrating from Google Photo. I've never had a great management strategy for photos and knew it would be time consuming. Here's a few things that may be helpful to others.
- Google Takeout provides access to download your data from Google, including photos. By default it provides 2GB zip files with these photos. I had 48 of these files.
- Instead of manually extracting each zip file, script a file to loop through each zip and extract. Using AI or the sample below can help.
#!/bin/bash
SOURCE_DIR="/your/path/to/zip/file/directory"
for f in $SOURCE_DIR
do
echo "filename: '$f'"
7z x "$(basename $f" -o/path/to/where/to/extract/
done
- You're going to want to access your drive via the terminal and probably already have if you followed the step above. This probably includes mounting your photos share.
- At this point I recommend using a tool like Yazi which navigates the share in your terminal but also provides previews for images in the terminal. You'll need to be using a terminal that supports this, I recommend Ghostty.
- Also some of files are old and the exif data has been overwritten or was just never correct. Using a tool like ExifTool, you can update the files with the correct info. It work with multiple files and entire directories also. The example below came in helpful when trying to fix incorrect dates for the photos.
exiftool '-FileCreateDate<DateTimeOriginal' '-FileModifyDate<DateTimeOriginal' /path/to/files/
- Finally I have found using Immich to be a great experience. You'll need to point it to your photo share as an external library and all it to scan the directory. From there you should have all your photos and after verifying you should be able to delete the files from Google Photos.
"Funny" aside to all this is when I downloaded my photos from Google Takeout, for some reason I had a directory named "" in the extracted files. Not sure if this was a boneheaded move on Google's part or a possible typo on mine. Either way, while cleaning up photos and needing to delete this directory, I realized that there's a significant difference between rmdir /* and rmdir \*. Luckily my OS did not let me delete my entire hard drive but yeah, I definitely realized that's a helluva a typo.