Apple Photos to Immich migration
I need help with moving my Apple Photos library contents to Immich. I have 250GB of photos and videos currently in an Apple Photos library file. This file is stored on a share in my Unraid server (different share than where immich is pointed to). There are no photos stored in iCloud. I want to move all photos from the Apple Photos file to immich and be able to delete the Apple Photos library.
16 Replies
:wave: Hey @TinkerTornado,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :ballot_box_with_check: reviewed the FAQs for known issues.
4. :ballot_box_with_check: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :ballot_box_with_check: uploaded the relevant information (see below).
7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:okay so after a fair bit of research it looks like people have done this buy using osxphotos (https://github.com/RhetTbull/osxphotos) to export, and immich-go (https://github.com/simulot/immich-go) to import. I've tried reading through the respective docs but i get lost with all the possible flags. Hoping that someone can help me assemble a process to follow. My goal is to move everything in original quality and with all metadata that currently exists (mostly camera info, location, faces/people)
I took a look at that osxphotos library. I think you could use the command below to export into a year/month/photo.jpg structure, preserving the date. I've added the --dry-run option which will only process the files, but won't actually export them, as a test.
I'd recommend installing exiftool (https://exiftool.org/) and adding the --exiftool flag in order to preserve more metadata like like location, description, etc. You might have to set the --exiftool-path /path/to/exiftool if it can't find it after installing.
It might even work to, after importing using immich-go, export again but change the directory flag to use album names (--directory "{folder_album}"), then import again and it might create the albums for you.
Keep in mind this is not at all tested by me as I don't have a Mac. Osxphotos has a tutorial section on their github that explains in great details what most of the different options do, with examples.
osxphotos export /path/to/export/dir --directory "{created.year}/{created.month}" --touch-file --dry-run
ExifTool by Phil Harvey
A command-line application and Perl library for
reading and writing EXIF, GPS, IPTC, XMP, makernotes and other meta information
in image, audio and video files. For Windows, MacOS, and Unix systems.
phase 1 is running, which is the export of all files out of Apple Photos. after reading through all the export docs I build this command:
Getting occasional hangs on creating xmp sidecar for some videos. Having to abort with
ctrl+c
and restart with the --update
flag. This will run it again, but skip the ones that already completed successfully. The same videos seem to always hang, so its taken several reruns to get about 1/2 done.Hopefully all finished soon! Photos seem to be exporting correctly though, with correct metadata?
as much as one can hope for without setting every flag for exiftool and sidecar manually
Export is complete, I found that the ~5 videos causing the sidecar issues were always hanging the process. I didnt have any favorited media so I favorited them and added the
--not-favorite
flag, though it could also could have been done with the `--not-hidden
flag.
Next step is to use Immich-go to import, reading docs now
Im getting this error when im doing my upload via immich-go:
Client timeout is a flag that can be set, so im doubling the value to give it more time (the file is almost 10gb)Do you have apikey set?
Also is "ApplePhotosExport:2024" a directory? Or should that ":" be "/" instead?
this is the error read out, so its not my path. best i can tell its just a timeout on a too large file not uploading in 5 min, the increase on that
--client-timeout
flag should fix it, but ill report back
Yep that extra time has fixed it, import has been successful
btw this is the import command that I used (path, server ip, and key masked) Glad it all worked out! Did it create the albums and such for you as well?
it didn't but im okay with that, i haven't actually made albums in a few years, ill eventually go and sort all the photos
Oh nice, thanks for this! I just used the export in Apple Photos.app and now I'm adding all those files via web ui. I guess I will redo that with these scripts.
@TinkerTornado I ran that immich-go command you posted, it uploaded over half of the images but then I got an error:
2025-04-22 09:22:30 ERR AssetUpload, POST, http://192.168.178.102:2283/api/assets, 500 Internal Server Error
Failed to upload asset and it stopped doing anything. Did you experience something like that? Any ideas what the error could be?
Failed to upload asset and it stopped doing anything. Did you experience something like that? Any ideas what the error could be?
Check immich logs to see if it had any issues?
found this:
2025-04-22 18:43:04.686 UTC [60] ERROR: duplicate key value violates unique constraint "PK_ef5346fe522b5fb3bc96454747e"
2025-04-22 18:43:04.686 UTC [60] DETAIL: Key ("assetsId", "tagsId")=(2573a8cd-e62c-4e7d-a485-a26abc5fe081, 7dd05c2a-75ff-4bce-9ae6-c806efa0e460) already exists.
2025-04-22 18:43:04.686 UTC [60] STATEMENT: insert into "tag_asset" ("tagsId", "assetsId") values ($1, $2)
Hmm, this might be better to open as a separate issue/bug report to get more eyes on it. I'm not sure how the keys are created and handled, but duplicates during an import sounds like problem.
Ok I realise am late to the party and also I haven't tried this myself but I remember I saw a post on reddit with someone just installing the iPad immich app on their Mac and migrated a rather large library. Obviously this only works for newer Macs (M1 and newer) because you cannot install iPad apps on Intel.
I tried that iOS app too, it creates albums which is nice, but I had wrong dates. Like a picture from march which I favorited in april, had the april date in Immich.
So I tried these tools which work better for me. In Immich the setting to import Faces from Exif/sidecar should be activated, and the import command needs an --on-server-errors continue
with that it works fine. Only downside so far is, that the albums are not created as albums but as tags.