[PR #1117] [MERGED] chore(server) Add job for storage migration #8912

Closed
opened 2026-02-05 13:55:22 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/1117
Author: @alextran1502
Created: 12/18/2022
Status: Merged
Merged: 12/19/2022
Merged by: @alextran1502

Base: mainHead: chore/migrate-existing-files-to-new-storage-template


📝 Commits (10+)

  • f3c3645 Refactor BullModule registration
  • 09335d4 Fix query to get asset with no thumbnail to exclude livephoto motion part
  • 0db07cf Added migration logic
  • 45dcf1d Remove testing code
  • 5f05e92 Fixed server crash when user profile image is deleted from disk
  • 0cf3452 Add footnote to show migration info
  • 8d13a64 styling
  • 461e570 wording
  • 3131db2 revert module registration so that microservice tasks are ran in microservice
  • 2edb4b6 Added queue to trigger template change in Microservices processor

📊 Changes

33 files changed (+398 additions, -241 deletions)

View changed files

📝 mobile/openapi/doc/AllJobStatusResponseDto.md (+2 -0)
📝 mobile/openapi/lib/model/all_job_status_response_dto.dart (+19 -3)
📝 mobile/openapi/lib/model/job_id.dart (+3 -0)
📝 mobile/openapi/test/all_job_status_response_dto_test.dart (+10 -0)
📝 server/apps/immich/src/api-v1/asset/asset-repository.ts (+9 -8)
📝 server/apps/immich/src/api-v1/asset/asset.module.ts (+2 -17)
📝 server/apps/immich/src/api-v1/job/dto/get-job.dto.ts (+1 -0)
📝 server/apps/immich/src/api-v1/job/job.module.ts (+6 -52)
📝 server/apps/immich/src/api-v1/job/job.service.ts (+34 -0)
📝 server/apps/immich/src/api-v1/job/response-dto/all-job-status-response.dto.ts (+6 -0)
📝 server/apps/immich/src/api-v1/system-config/system-config.module.ts (+8 -1)
📝 server/apps/immich/src/api-v1/system-config/system-config.service.ts (+10 -1)
📝 server/apps/immich/src/api-v1/user/user.service.ts (+4 -1)
📝 server/apps/immich/src/app.module.ts (+2 -13)
📝 server/apps/immich/src/modules/background-task/background-task.module.ts (+0 -5)
📝 server/apps/immich/src/modules/schedule-tasks/schedule-tasks.module.ts (+2 -34)
📝 server/apps/microservices/src/microservices.module.ts (+9 -73)
server/apps/microservices/src/processors/storage-migration.processor.ts (+61 -0)
📝 server/apps/microservices/src/processors/thumbnail.processor.ts (+6 -21)
📝 server/immich-openapi-specs.json (+11 -2)

...and 13 more files

📄 Description

This PR added a storage migration job with the old path/template for existing assets. The migration job can be invoked from the web interface by the admin.

TODO

  • migrated file with duplicated file name has an appended number, i.e., _1. This won't be detected for a newer migration because the EXIF always shows the original name - i.e, need to update EXIF after migration.
  • Migrate the live photo's motion part with the same name as the original photo part
  • Add note on the storage template setting that the user can perform migration action

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/1117 **Author:** [@alextran1502](https://github.com/alextran1502) **Created:** 12/18/2022 **Status:** ✅ Merged **Merged:** 12/19/2022 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `chore/migrate-existing-files-to-new-storage-template` --- ### 📝 Commits (10+) - [`f3c3645`](https://github.com/immich-app/immich/commit/f3c3645ce71dab85dc98d2230dd4f19eb2c26684) Refactor BullModule registration - [`09335d4`](https://github.com/immich-app/immich/commit/09335d4635c6cd0aa71cf3b97a0b8362dd46ed09) Fix query to get asset with no thumbnail to exclude livephoto motion part - [`0db07cf`](https://github.com/immich-app/immich/commit/0db07cf2b932c7b0d97467083149e9d1fe97e664) Added migration logic - [`45dcf1d`](https://github.com/immich-app/immich/commit/45dcf1dad334bc9420afff46d79a11afc73c14bd) Remove testing code - [`5f05e92`](https://github.com/immich-app/immich/commit/5f05e92e79be7a7a724aa88d3519031c91638218) Fixed server crash when user profile image is deleted from disk - [`0cf3452`](https://github.com/immich-app/immich/commit/0cf345239dc74bc1942eb2557e12d868eaa956ec) Add footnote to show migration info - [`8d13a64`](https://github.com/immich-app/immich/commit/8d13a6437b8ac03170271de92483c9b2af4cb1a7) styling - [`461e570`](https://github.com/immich-app/immich/commit/461e570c14c72fc995865237d829168ad779e690) wording - [`3131db2`](https://github.com/immich-app/immich/commit/3131db2075780e5245bfa4a39e907e8e040e786b) revert module registration so that microservice tasks are ran in microservice - [`2edb4b6`](https://github.com/immich-app/immich/commit/2edb4b61e8bf1320c59021ea7e4b3e2fe9783189) Added queue to trigger template change in Microservices processor ### 📊 Changes **33 files changed** (+398 additions, -241 deletions) <details> <summary>View changed files</summary> 📝 `mobile/openapi/doc/AllJobStatusResponseDto.md` (+2 -0) 📝 `mobile/openapi/lib/model/all_job_status_response_dto.dart` (+19 -3) 📝 `mobile/openapi/lib/model/job_id.dart` (+3 -0) 📝 `mobile/openapi/test/all_job_status_response_dto_test.dart` (+10 -0) 📝 `server/apps/immich/src/api-v1/asset/asset-repository.ts` (+9 -8) 📝 `server/apps/immich/src/api-v1/asset/asset.module.ts` (+2 -17) 📝 `server/apps/immich/src/api-v1/job/dto/get-job.dto.ts` (+1 -0) 📝 `server/apps/immich/src/api-v1/job/job.module.ts` (+6 -52) 📝 `server/apps/immich/src/api-v1/job/job.service.ts` (+34 -0) 📝 `server/apps/immich/src/api-v1/job/response-dto/all-job-status-response.dto.ts` (+6 -0) 📝 `server/apps/immich/src/api-v1/system-config/system-config.module.ts` (+8 -1) 📝 `server/apps/immich/src/api-v1/system-config/system-config.service.ts` (+10 -1) 📝 `server/apps/immich/src/api-v1/user/user.service.ts` (+4 -1) 📝 `server/apps/immich/src/app.module.ts` (+2 -13) 📝 `server/apps/immich/src/modules/background-task/background-task.module.ts` (+0 -5) 📝 `server/apps/immich/src/modules/schedule-tasks/schedule-tasks.module.ts` (+2 -34) 📝 `server/apps/microservices/src/microservices.module.ts` (+9 -73) ➕ `server/apps/microservices/src/processors/storage-migration.processor.ts` (+61 -0) 📝 `server/apps/microservices/src/processors/thumbnail.processor.ts` (+6 -21) 📝 `server/immich-openapi-specs.json` (+11 -2) _...and 13 more files_ </details> ### 📄 Description This PR added a storage migration job with the old path/template for existing assets. The migration job can be invoked from the web interface by the admin. ## TODO - [x] migrated file with duplicated file name has an appended number, i.e., `_1`. This won't be detected for a newer migration because the EXIF always shows the original name - i.e, ~need to update EXIF after migration.~ - [x] Migrate the live photo's motion part with the same name as the original photo part - [x] Add note on the storage template setting that the user can perform migration action --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 13:55:22 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#8912