63 lines
1.6 KiB
Markdown
63 lines
1.6 KiB
Markdown
# 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
|
|
|
|
- [x] Create folders like "Misc {{year}}" for photos that are not in albums
|
|
- [x] Delete assets that are deleted in Immich but exist on the local disk
|
|
- [x] 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:
|
|
|
|
```bash
|
|
# 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:
|
|
|
|
```bash
|
|
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
|
|
```bash
|
|
docker build -t immortaly007/immich-exporter .
|
|
docker push immortaly007/immich-exporter
|
|
```
|
|
|
|
## Development
|
|
|
|
### Generate OpenAPI spec
|
|
|
|
```bash
|
|
rm -rf generated/immich
|
|
docker run --rm \
|
|
-u $UID:$UID \
|
|
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
|
|
-i https://github.com/immich-app/immich/raw/refs/heads/main/open-api/immich-openapi-specs.json \
|
|
-g python \
|
|
--skip-operation-example \
|
|
--additional-properties generateSourceCodeOnly=true,packageName="generated.immich.openapi_client" \
|
|
-o /local/
|
|
```
|