Script to export immich data as a structured folder. Useful if you want to browse your albums etc when immich is broken.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-03 20:43:04 +02:00
.idea [TASK] Initial version, with some help from Junie. Copies all files in albums to the local filesystem. 2025-04-19 18:05:53 +02:00
.openapi-generator [CLEANUP] Cleaner API gen (less unneeded stuff) 2026-07-03 20:42:47 +02:00
generated [TWEAK] Added missing files 2026-07-03 20:43:04 +02:00
scripts [TWEAK] Added missing files 2026-07-03 20:43:04 +02:00
.aiignore [TASK] Added Dockerfile to build docker container 2025-05-29 21:21:56 +02:00
.dockerignore [TASK] Cleaner docker image and instructions on how to publish/push it 2025-05-30 00:03:17 +02:00
.editorconfig [TASK] Initial version, with some help from Junie. Copies all files in albums to the local filesystem. 2025-04-19 18:05:53 +02:00
.env.example [TASK] Delete assets that are deleted in Immich but exist on the local disk 2025-05-29 21:48:27 +02:00
.gitignore [TASK] Initial version, with some help from Junie. Copies all files in albums to the local filesystem. 2025-04-19 18:05:53 +02:00
.openapi-generator-ignore [TASK] Initial version, with some help from Junie. Copies all files in albums to the local filesystem. 2025-04-19 18:05:53 +02:00
Dockerfile [TASK] Added Dockerfile to build docker container 2025-05-29 21:21:56 +02:00
immich-export.py [TASK] (untested) Updated API to work with Immich 3.0 2026-07-03 20:13:42 +02:00
README.md [CLEANUP] Cleaner API gen (less unneeded stuff) 2026-07-03 20:42:47 +02:00
requirements.txt [TASK] Save images that are not in albums to "Misc {{year}}" folders 2025-05-29 21:15:17 +02:00

Immich to cloud exporter

Script to export immich data as a structured folder. Useful if you want to browse your albums etc when immich is broken.

To-do

  • Create folders like "Misc {{year}}" for photos that are not in albums
  • Delete assets that are deleted in Immich but exist on the local disk
  • Dockerize the tool so it's easy to run on the server
  • Stretch: Preserve metadata (e.g. file creation times)
  • Stretch: directly sync to Proton Drive (skipping the local filesystem)

Usage

Docker

You can build and run this tool using Docker:

# Build the Docker image
docker build -t immich-to-cloud-exporter .

# Run the container
docker run -it --rm \
  -e IMMICH_HOST=http://your-immich-server:2283/api \
  -e IMMICH_API_KEY=your_api_key \
  -v /path/to/local/export:/app/export \
  immich-to-cloud-exporter

To run with the dry-run flag:

docker run --rm \
  -e IMMICH_HOST=http://your-immich-server:2283/api \
  -e IMMICH_API_KEY=your_api_key \
  -v /path/to/local/export:/app/export \
  immich-to-cloud-exporter --dry-run

Build and publish

docker build -t immortaly007/immich-exporter .
docker push immortaly007/immich-exporter

Development

Generate OpenAPI spec

Only the Albums, Assets, and Search APIs are generated (the only ones this tool uses) and docs/tests are skipped, to keep the generated client small. The generator version is pinned to v7.9.0 because newer versions ship a codegen bug that drops the field_validator import from some pydantic models; scripts/fix_field_validator_imports.py patches around it.

rm -rf generated/immich
docker run --rm \
  -u $UID:$UID \
  -v ${PWD}:/local openapitools/openapi-generator-cli:v7.9.0 generate \
  -i https://github.com/immich-app/immich/raw/refs/heads/main/open-api/immich-openapi-specs.json \
  -g python \
  --global-property apis="Albums:Assets:Search",models="",supportingFiles="",apiTests=false,apiDocs=false,modelTests=false,modelDocs=false \
  --additional-properties generateSourceCodeOnly=true,packageName="generated.immich.openapi_client" \
  -o /local/

python3 scripts/fix_field_validator_imports.py