From 9bb6265bbd544664ce22f776a38233bc9caa0f2d Mon Sep 17 00:00:00 2001 From: martabal <74269598+martabal@users.noreply.github.com> Date: Tue, 1 Oct 2024 19:24:05 +0200 Subject: [PATCH] chore: update the migration guide --- MIGRATION.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 8 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index ea7b5ef..c0045c1 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,23 +1,84 @@ -# Unraid: Migrate from docker-compose +# How to migrate > [!IMPORTANT] > Pre-read all these steps before doing anying, if you are confused open an issue -When using the official Immich docker-compose, the PostgreSQL data is stored in a docker volume which _should_ be located at `/var/lib/docker/volumes/pgdata/_data`. Before preceeding you **must** stop the docker-compose stack. +## Migrate from docker-compose -## 1. Move the database +### 1. Move the database Install `PostgreSQL_Immich` from the Unraid CA and remove these variables from the template: `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`. The database is already initialised and these variables don't do anything. -Also set `Database Storage Path` to `/mnt/user/appdata/PostgreSQL_Immich`. +Change the `Database Storage Path` to match the `DB_DATA_LOCATION` value -## 2. Setup the `martabal/immich` container +### 2. Setup the `martabal/immich` container -Instal the unraid CA for +If you use unraid, instal the unraid CA for > [!WARNING] > You must configure the template to the values listed in the docker-compose .env -Ensure that the template matches the `DB_USERNAME`, `DB_PASSWORD`, `DB_DATABASE_NAME` from the .env. Add a new env `IMMICH_MEDIA_LOCATION` and set it to `/usr/src/app/upload`, then set `Path: /photos` to your previous `UPLOAD_LOCATION` path. +Ensure that the template matches the `DB_USERNAME`, `DB_PASSWORD`, `DB_DATABASE_NAME` from the .env. -Click Apply, Open the WebUI and login. Everything _Should_ be as it was. +#### If you have uploaded assets after migrating from the docker-compose + +Add a new env `IMMICH_MEDIA_LOCATION` and set it to `/usr/src/app/upload`, then set `Path: /photos` to your previous `UPLOAD_LOCATION` path. + +```yaml +services: + immich: + image: ghcr.io/martabal/immich:latest + environment: ... + - IMMICH_MEDIA_LOCATION=/usr/src/app/upload +``` + +#### If you didn't uploaded assets after migrating from the docker-compose + +Add a new volume where the host path is the same as the one mounted to `/photos` and mount it to `/app/immich/server/upload` + +```yaml +services: + immich: + image: ghcr.io/martabal/immich:latest + ... + volumes: + - path_to_appdata:/config + - path_to_photos:/photos + - path_to_libraries:/libraries + - path_to_photos:/app/immich/server/upload +``` + +## Migrate to docker-compose + +### 1. Setup + +Install the official containers following the official guide [here](https://immich.app/docs/developer/setup/) + +### 2. Edit the `.env` + +Edit the `DB_USERNAME` and `DB_DATABASE_NAME` environment variables to match the one you had with the `martabal/immich` container: + +Change `DB_DATA_LOCATION` and `UPLOAD_LOCATION` to match the previous host volumes: + +- `path_to_postgres` → `DB_DATA_LOCATION` +- `path_to_photos` → `UPLOAD_LOCATION` + +#### If you have uploaded assets after migrating to the docker-compose + +Add a new env `IMMICH_MEDIA_LOCATION=/photos` to your `.env` + +#### If you have not uploaded assets after migrating to the docker-compose + +Add a new volume to the immich-server container `${UPLOAD_LOCATION}:/photos` + +```yaml +services: + immich-server: + ... + volumes: + - ${UPLOAD_LOCATION}:/usr/src/app/upload + - /etc/localtime:/etc/localtime:ro + - ${UPLOAD_LOCATION}:/photos +``` + +Everything _should_ be as it was.