I
Immich•2w ago
Ray

Recently upgraded my immich versions - immich now thinks it's a fresh install

1. I edited the DB_DATA_LOCATION and moved from /opt/docker/immich_postgres to opt/docker/appdata/immich_postgres 2. Done a docker pull to get the latest version
Starting microservices worker
[Nest] 7 - 09/20/2025, 1:58:36 PM LOG [Microservices:EventRepository] Initialized websocket server
[Nest] 7 - 09/20/2025, 1:58:37 PM WARN [Microservices:DatabaseService] DEPRECATION WARNING: The pgvecto.rs extension is deprecated and support for it will be removed very soon.
See https://immich.app/docs/install/upgrading#migrating-to-vectorchord in order to switch to the VectorChord extension instead.
[Nest] 7 - 09/20/2025, 1:58:37 PM WARN [Microservices:DatabaseRepository] Migration "1744910873969-InitialMigration" failed
[Nest] 7 - 09/20/2025, 1:58:37 PM ERROR [Microservices:DatabaseRepository] Migrations failed: Error: Invalid upgrade path. For more information, see https://immich.app/errors#typeorm-upgrade
Error: Invalid upgrade path. For more information, see https://immich.app/errors#typeorm-upgrade
at Object.up (/usr/src/app/server/dist/schema/migrations/1744910873969-InitialMigration.js:19:19)
Starting microservices worker
[Nest] 7 - 09/20/2025, 1:58:36 PM LOG [Microservices:EventRepository] Initialized websocket server
[Nest] 7 - 09/20/2025, 1:58:37 PM WARN [Microservices:DatabaseService] DEPRECATION WARNING: The pgvecto.rs extension is deprecated and support for it will be removed very soon.
See https://immich.app/docs/install/upgrading#migrating-to-vectorchord in order to switch to the VectorChord extension instead.
[Nest] 7 - 09/20/2025, 1:58:37 PM WARN [Microservices:DatabaseRepository] Migration "1744910873969-InitialMigration" failed
[Nest] 7 - 09/20/2025, 1:58:37 PM ERROR [Microservices:DatabaseRepository] Migrations failed: Error: Invalid upgrade path. For more information, see https://immich.app/errors#typeorm-upgrade
Error: Invalid upgrade path. For more information, see https://immich.app/errors#typeorm-upgrade
at Object.up (/usr/src/app/server/dist/schema/migrations/1744910873969-InitialMigration.js:19:19)
52 Replies
Immich
Immich•2w ago
:wave: Hey @Ray, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time). 2. :blue_square: read applicable release notes. 3. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed.
Mraedis
Mraedis•2w ago
1. I edited the DB_DATA_LOCATION and moved from /opt/docker/immich_postgres to opt/docker/appdata/immich_postgres
So you set up a completely new database and then you are suprised your database is new?
Zeus
Zeus•2w ago
Was your old version pre 132? I think thats the error here
Mraedis
Mraedis•2w ago
THat too 😛 Looking at the screenshots the previous version was from februari
Ray
RayOP•2w ago
no? mv /opt/docker/immich_postgres /opt/docker/appdata/immich_postgres lol
Mraedis
Mraedis•2w ago
Yeah also you can't do that But you need to downgrade to v1.136.0 first
Ray
RayOP•2w ago
Oh ok
Mraedis
Mraedis•2w ago
See https://immich.app/errors/#typeorm-upgrade Did you follow all other breaking changes too? Specifically https://github.com/immich-app/immich/discussions/18429
Immich
Immich•2w ago
[Discussion] v1.133.0 (immich-app/immich#18429)
Ray
RayOP•2w ago
I accidentally updated immich. I ran docker-compose pull and it fetched the latest version I didn't mean for it to do that Was an accident My docker-compose is quite confusing
Ray
RayOP•2w ago
Pastebin
immich-server: container_name: immich_server image: ghcr.io...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Ray
RayOP•2w ago
And my env variables
# Immich
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/nas/data/photos
# The location where your database files are stored
DB_DATA_LOCATION=/opt/docker/appdata/immich-postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release
# Immich
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/nas/data/photos
# The location where your database files are stored
DB_DATA_LOCATION=/opt/docker/appdata/immich-postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release
Mraedis
Mraedis•2w ago
If you're using latest version all you need to do is change IMMICH_VERSION=v1.136.0 at the bottom, do a compose pull, wait for the migration to finish after startup and then change back to release
Ray
RayOP•2w ago
Thanks brother I'll give that a shot now
hint: 'Check free disk space.',
file: 'md.c',
line: '451',
routine: 'mdextend'
},
sql: '\n' +
' UPDATE "assets"\n' +
' SET "visibility" = CASE\n' +
` WHEN "isArchived" THEN 'archive'::asset_visibility_enum\n` +
` WHEN "isVisible" THEN 'timeline'::asset_visibility_enum\n` +
" ELSE 'hidden'::asset_visibility_enum\n" +
' END;\n' +
' ',
params: []
}
[Nest] 7 - 09/20/2025, 2:18:03 PM ERROR [Microservices:DatabaseRepository] Kysely migrations failed: PostgresError: could not extend file "base/16384/16898": No space left on device
[Nest] 7 - 09/20/2025, 2:18:03 PM LOG [Microservices:DatabaseRepository] Migration "1744910873969-InitialMigration" succeeded
[Nest] 7 - 09/20/2025, 2:18:03 PM LOG [Microservices:DatabaseRepository] Migration "1744991379464-AddNotificationsTable" succeeded
[Nest] 7 - 09/20/2025, 2:18:03 PM LOG [Microservices:DatabaseRepository] Migration "1745244781846-AddUserAvatarColorColumn" succeeded
[Nest] 7 - 09/20/2025, 2:18:03 PM WARN [Microservices:DatabaseRepository] Migration "1745902563899-AddAssetVisibilityColumn" failed
hint: 'Check free disk space.',
file: 'md.c',
line: '451',
routine: 'mdextend'
},
sql: '\n' +
' UPDATE "assets"\n' +
' SET "visibility" = CASE\n' +
` WHEN "isArchived" THEN 'archive'::asset_visibility_enum\n` +
` WHEN "isVisible" THEN 'timeline'::asset_visibility_enum\n` +
" ELSE 'hidden'::asset_visibility_enum\n" +
' END;\n' +
' ',
params: []
}
[Nest] 7 - 09/20/2025, 2:18:03 PM ERROR [Microservices:DatabaseRepository] Kysely migrations failed: PostgresError: could not extend file "base/16384/16898": No space left on device
[Nest] 7 - 09/20/2025, 2:18:03 PM LOG [Microservices:DatabaseRepository] Migration "1744910873969-InitialMigration" succeeded
[Nest] 7 - 09/20/2025, 2:18:03 PM LOG [Microservices:DatabaseRepository] Migration "1744991379464-AddNotificationsTable" succeeded
[Nest] 7 - 09/20/2025, 2:18:03 PM LOG [Microservices:DatabaseRepository] Migration "1745244781846-AddUserAvatarColorColumn" succeeded
[Nest] 7 - 09/20/2025, 2:18:03 PM WARN [Microservices:DatabaseRepository] Migration "1745902563899-AddAssetVisibilityColumn" failed
WHAT?
Mraedis
Mraedis•2w ago
It says your disk is full
bo0tzz
bo0tzz•2w ago
Disk is full
Ray
RayOP•2w ago
For which disk the mount or the immich_database files?
Mraedis
Mraedis•2w ago
df -hT and you'll see
Ray
RayOP•2w ago
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 795M 1.4M 793M 1% /run
/dev/sda1 ext4 31G 30G 0 100% /
tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
//10.10.10.4/nas cifs 11T 1.4T 9.5T 13% /mnt/nas
tmpfs tmpfs 795M 0 795M 0% /run/user/1000
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 795M 1.4M 793M 1% /run
/dev/sda1 ext4 31G 30G 0 100% /
tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
//10.10.10.4/nas cifs 11T 1.4T 9.5T 13% /mnt/nas
tmpfs tmpfs 795M 0 795M 0% /run/user/1000
Thank you It looks like the immich-postgres folder (db location) is gigantic. Is it possible for me to migrate immich_postgres to my mount without anything breaking?
bo0tzz
bo0tzz•2w ago
Define "gigantic"?
Mraedis
Mraedis•2w ago
Sounds more to me like you need to do a proper docker image prune
Ray
RayOP•2w ago
2.3G /opt/docker/appdata/immich-postgres/
bo0tzz
bo0tzz•2w ago
Seems normal to me
Ray
RayOP•2w ago
But how is a shitty little debian server using 32GB? It only uses docker?!
Mraedis
Mraedis•2w ago
.
Ray
RayOP•2w ago
Total reclaimed space: 2.886GB
Mraedis
Mraedis•2w ago
yay space
Ray
RayOP•2w ago
Guys I really appreciate your help here, even though this isn't specifically an immich problem I really really appreciate it ❤️ I will return the favour one day
bo0tzz
bo0tzz•2w ago
You should probably give your root more space fwiw
Mraedis
Mraedis•2w ago
There is none to give
Ray
RayOP•2w ago
No description
Ray
RayOP•2w ago
It's maxed out at 32GB
Mraedis
Mraedis•2w ago
oh it's a VM
Ray
RayOP•2w ago
I thought that would be enough
Mraedis
Mraedis•2w ago
yeah add more
Ray
RayOP•2w ago
Just a quick question Shall i put database files and stuff on my mount server generally? And keep my docker server as just bare minimal
Mraedis
Mraedis•2w ago
No don't put those over the network
Ray
RayOP•2w ago
Oh ok I think this VM needs to be recreated. I created this debian server without an LVM So increasing disk space seems tricky Would my best bet here be to create another debian server with LVM? And migrate everything over to that?
bo0tzz
bo0tzz•2w ago
Nah growing a part isn't too hard
Mraedis
Mraedis•2w ago
Pretty sure you can just yeet it to 64 and then grow2fs 10GB for docker images, 5GB for ML cache, 4GB for the database Give or take
Ray
RayOP•2w ago
I wrote these notes last time I increased it from 16GB
1. `sudo fdisk /dev/sda`
1. `sudo fdisk /dev/sda`
Disk /dev/sda: 32 GiB, 34359738368 bytes, 67108864 sectors Disk model: QEMU HARDDISK Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xe455747f Device Boot Start End Sectors Size Id Type /dev/sda1 2048 31553535 31551488 15G 83 Linux /dev/sda2 31555582 33552383 1996802 975M 5 Extended /dev/sda5 31555584 33552383 1996800 975M 82 Linux swap / Solaris
2. Delete and Recreate `/dev/sda1` with Reserved Space**
1. **Delete `/dev/sda1`:**
- Press `d` and delete partition `1`.
2. **Recreate `/dev/sda1`:**
- Press `n` to create a new primary partition.
- Set it as partition `1`.
- Use the same **starting sector** as before (this ensures no data loss).
- For the **ending sector**, leave enough space for the extended and swap partitions. For example:
- Subtract around 1 GB from the total disk size (for swap and extended partition).
3. **Write Changes:**
- Press `w` to save changes and exit.

3. Create the Extended and Swap Partitions**
Reopen `fdisk` to create the remaining partitions:

1. **Create the Extended Partition (`/dev/sda2`):**
- Press `n` to create a new partition.
- Choose `extended` and set it as partition `2`.
- Use the remaining free space on the disk.
2. **Create the Swap Partition (`/dev/sda5`):**
- Press `n` again to create a new **logical partition** inside the extended partition.
- Allocate the remaining space to this partition (around 975M as before).
3. **Write Changes:**
- Press `w` to save and exit.
2. Delete and Recreate `/dev/sda1` with Reserved Space**
1. **Delete `/dev/sda1`:**
- Press `d` and delete partition `1`.
2. **Recreate `/dev/sda1`:**
- Press `n` to create a new primary partition.
- Set it as partition `1`.
- Use the same **starting sector** as before (this ensures no data loss).
- For the **ending sector**, leave enough space for the extended and swap partitions. For example:
- Subtract around 1 GB from the total disk size (for swap and extended partition).
3. **Write Changes:**
- Press `w` to save changes and exit.

3. Create the Extended and Swap Partitions**
Reopen `fdisk` to create the remaining partitions:

1. **Create the Extended Partition (`/dev/sda2`):**
- Press `n` to create a new partition.
- Choose `extended` and set it as partition `2`.
- Use the remaining free space on the disk.
2. **Create the Swap Partition (`/dev/sda5`):**
- Press `n` again to create a new **logical partition** inside the extended partition.
- Allocate the remaining space to this partition (around 975M as before).
3. **Write Changes:**
- Press `w` to save and exit.
4. **Format and Configure the Filesystems**
1. **Resize the Filesystem on `/dev/sda1`:** If your filesystem is `ext4`:
`sudo resize2fs /dev/sda1`
2. **Reinitialize the Swap Partition:**
`sudo mkswap /dev/sda5 sudo swapon /dev/sda5`
3. **Update `/etc/fstab`:** Get the new UUIDs:
`sudo blkid`
Update `/etc/fstab` with the UUIDs for the updated partitions (should just be sda5 as we rebooted so sda1 should've automatically fixed)

systemctl daemon-reload

mount -av
4. **Format and Configure the Filesystems**
1. **Resize the Filesystem on `/dev/sda1`:** If your filesystem is `ext4`:
`sudo resize2fs /dev/sda1`
2. **Reinitialize the Swap Partition:**
`sudo mkswap /dev/sda5 sudo swapon /dev/sda5`
3. **Update `/etc/fstab`:** Get the new UUIDs:
`sudo blkid`
Update `/etc/fstab` with the UUIDs for the updated partitions (should just be sda5 as we rebooted so sda1 should've automatically fixed)

systemctl daemon-reload

mount -av
is this pretty much what i need to do again? or is there a simpler way/? I did chatgpt that a few months ago, and it did work But if there's a simpler way I would really prefer doing that
Mraedis
Mraedis•2w ago
that sounds about right except for I don't see what dev sda 2 is doing there? nevermind me :p
Ray
RayOP•2w ago
Shall I just make another VM with an LVM? Would migrating over cause any issues?
Mraedis
Mraedis•2w ago
No, migrating is easy
Mraedis
Mraedis•2w ago
Literally this
Ray
RayOP•2w ago
I did prune and free up the space Another error this time
Starting microservices worker
[Nest] 7 - 09/20/2025, 2:41:28 PM LOG [Microservices:EventRepository] Initialized websocket server
[Nest] 7 - 09/20/2025, 2:41:28 PM LOG [Microservices:DatabaseRepository] Running migrations, this may take a while
[Nest] 18 - 09/20/2025, 2:41:28 PM LOG [Api:EventRepository] Initialized websocket server
[Nest] 7 - 09/20/2025, 2:41:29 PM LOG [Microservices:LoggingRepository] Database has up to date TypeORM migrations, skipping initial Kysely migration
Query failed : {
durationMs: 1.9374380000008387,
error: PostgresError: multiple primary keys for table "geodata_places" are not allowed
at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:794:26)
at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:480:6)
at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:315:9)
at Socket.emit (node:events:518:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
at TCP.onStreamRead (node:internal/stream_base_commons:189:23) {
s
Starting microservices worker
[Nest] 7 - 09/20/2025, 2:41:28 PM LOG [Microservices:EventRepository] Initialized websocket server
[Nest] 7 - 09/20/2025, 2:41:28 PM LOG [Microservices:DatabaseRepository] Running migrations, this may take a while
[Nest] 18 - 09/20/2025, 2:41:28 PM LOG [Api:EventRepository] Initialized websocket server
[Nest] 7 - 09/20/2025, 2:41:29 PM LOG [Microservices:LoggingRepository] Database has up to date TypeORM migrations, skipping initial Kysely migration
Query failed : {
durationMs: 1.9374380000008387,
error: PostgresError: multiple primary keys for table "geodata_places" are not allowed
at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:794:26)
at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:480:6)
at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js:315:9)
at Socket.emit (node:events:518:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
at TCP.onStreamRead (node:internal/stream_base_commons:189:23) {
s
[Nest] 7 - 09/20/2025, 2:42:18 PM ERROR [Microservices:DatabaseRepository] Kysely migrations failed: PostgresError: multiple primary keys for table "geodata_places" are not allowed
[Nest] 7 - 09/20/2025, 2:42:18 PM ERROR [Microservices:DatabaseRepository] Kysely migrations failed: PostgresError: multiple primary keys for table "geodata_places" are not allowed
Immich
Immich•2w ago
[Issue] DB migration failing: multiple primary keys for table "geodata_places" are not allowed (immich-app/immich#20167)
Brazhh
Brazhh•2w ago
I have the same problem, i changed the database but because i change from root user to a new non-root user, how can i recover ?
Mraedis
Mraedis•2w ago
Well first off, make your own topic, secondly restore from backup

Did you find this page helpful?