How I Migrated My Entire Photo Library to Immich Without Duplicates - Over 120.000 Photos #8866
BoBBer446
started this conversation in
Community Guides
Replies: 1 comment
-
interesting. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the era of digital memories, managing a massive photo library can become a challenging endeavor, especially when moving away from popular services like Google Photos. Recently, I embarked on a significant project: transferring my entire collection of over 120,000 photos, which I had amassed over the years on Google Photos, to Immich, a self-hosted alternative. The goal was not just to move these images but to do so efficiently, ensuring no duplicates cluttered the new environment. Here’s how I tackled this hefty task.
The Challenge
Immich offers a robust API for uploads, but relying solely on this could potentially lead to duplicate entries, a common issue when dealing with extensive photo collections stored across different devices and services. Additionally, external libraries available for handling file transfers typically don't perform duplicate checking, which was crucial for my project.
Moreover, the complexity was further increased as both my girlfriend and I use Immich. This meant that two user accounts had to be managed simultaneously, each with their unique datasets.
Developing a Solution
To address these challenges, I developed a Python script tailored to handle the intricacies of our specific needs. The script can be found on my GitHub repository: python_copy2_image_duplicate_copy.
Here’s a breakdown of how the script functions:
Integration with Immich
To seamlessly integrate this solution into Immich, which runs in a Docker environment using docker-compose, I configured two new mounts according to the Immich documentation:
${EXTERNAL_PATH_USER1}:/usr/src/app/external/USER1
${EXTERNAL_PATH_USER2}:/usr/src/app/external/USER2
The corresponding environmental variables were set in the Docker ENV file as follows:
EXTERNAL_PATH_USER1=/var/lib/docker/bindmounts/ext_photos/USER1
EXTERNAL_PATH_USER2=/var/lib/docker/bindmounts/ext_photos/USER2
These settings allowed each user to have a dedicated external library within Immich, directly linked to the directories populated by the script.
The Outcome
The script successfully populated our Immich libraries without any duplicates, making our transition from Google Photos smooth and efficient. Each user can now access their unique set of images through Immich’s user-friendly interface, enjoying quick and easy retrieval of their digital memories.
References:
https://immich.app/docs/features/libraries/
https://immich.app/docs/features/command-line-interface
#8853 (comment)
Beta Was this translation helpful? Give feedback.
All reactions