Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anyway to migrate from docker-immich to docker-compose? #354

Open
wjfu99 opened this issue May 3, 2024 · 10 comments
Open

anyway to migrate from docker-immich to docker-compose? #354

wjfu99 opened this issue May 3, 2024 · 10 comments

Comments

@wjfu99
Copy link

wjfu99 commented May 3, 2024

Recently, I try to migrate from docker-immich to docker-compose, I map the /photos folder in docker-immich to /usr/src/app/upload/ in docker-compose version. But i found all the photos are unlinked and become into untracked files:
image
image

I guess in docker-immich's database, the uploading folder point to /photos, but in docker-compose's database, the uploading folder point to /usr/src/app/upload.
But i have no idea to slove this, i notice there is a issue about migrating from docker-compose to docker-immich #12 , i'm wonder if possible to migrate from docker-immich to docker-compose version?

@martabal
Copy link
Collaborator

martabal commented May 3, 2024

You just need to add - ${UPLOAD_LOCATION}:/photos to your docker-compose.yml

@wjfu99
Copy link
Author

wjfu99 commented May 4, 2024

@martabal Hi, thanks for your quick reply. If I understand correctly, I should add - ${UPLOAD_LOCATION}:/photos under - ${UPLOAD_LOCATION}:/usr/src/app/upload to my docker-compose.yml for immich-server and immich-micorservice, right? (If i just replace -${UPLOAD_LOCATION}:/usr/src/app/upload with - ${UPLOAD_LOCATION}:/photos, the newly added photos cannot be linked rightly, since them will still be added to the path /usr/src/app/upload).

After do that, the immich seems works well, but the issue raised in repair page let me a little annoy, the photos in /photos are marked as offline, the photos in /usr/src/app/upload are marked as untracked:
image
image

@wjfu99
Copy link
Author

wjfu99 commented May 4, 2024

And I'm concerned that this migration will pollute the database, since the older photos will be recorded with path /photos, and newer photos will be recorded with /usr/src/app/upload. Should I just ignore these warning, or consider elegant migration scheme?
Or just keep using docker-immich, for me two main concerns are:

  1. The computational consumption may be relatively higher?
  2. docker-immich may stop update one day.

@martabal
Copy link
Collaborator

martabal commented May 4, 2024

Have you already uploaded assets with the docker-compose.yml ?

@wjfu99
Copy link
Author

wjfu99 commented May 4, 2024 via email

@martabal
Copy link
Collaborator

martabal commented May 4, 2024

Sorry, what I mean is have you uploaded assets after migrating from the AIO docker image to the official docker images ?

@wjfu99
Copy link
Author

wjfu99 commented May 4, 2024

yes, i had tried to upload, the newly uploaded photos (here i mean i upload new photos, not the photos migrated from the old device) seems be treated well, it can be generated thumbnails, and can be previewed or downloaded. im just concern pollute the database.
if you mean upload the assets from the old device, i haven't do that, i just mount the / photos folder from the old device for the newer one.

@martabal
Copy link
Collaborator

martabal commented May 5, 2024

Weird, just adding - ${UPLOAD_LOCATION}:/photos should work fine. Are you sure you didn't have these errors even before the migration ?

@wjfu99
Copy link
Author

wjfu99 commented May 5, 2024

I'm pretty sure the offline path and untracked file errors not exist before migration, but the offline path can still be previewed and downloaded. I refer my docker-compose.yml file as following:

name: immich
services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: ['start.sh', 'immich']
    volumes:
      - ${UPLOAD_LOCATION}:/photos
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
 ...
  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardwa>
      file: hwaccel.transcoding.yml
      service: quicksync # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcod>
    command: ['start.sh', 'microservices']
    volumes:
      - ${UPLOAD_LOCATION}:/photos
      - ${UPLOAD_LOCATION}:/usr/src/app/upload

@wjfu99
Copy link
Author

wjfu99 commented May 9, 2024

Hi, guys, I think maybe I have found the most elegant solution w/o full of offline paths or untracked files.

  1. modify (not add!!!) - ${UPLOAD_LOCATION}:/usr/src/app/upload to - ${UPLOAD_LOCATION}:/photos in your docker-compose.yml
  2. add IMMICH_MEDIA_LOCATION=/photos to .env file, refer this link for details.
  3. docker compose pull & up, then all services will works well.
    If anyone still find errors, feel free to contact with me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants