Immich 2.6.3 - restore backup from 1.124.2

Hello everyone,

I have been trying to make this work for hours, so I have decided to ask here. I used to run Immich 1.124.2 on my TrueNAS Scale for some time, and I was putting off the updates due to a lack of time, but today I have decided to try to upgrade.

I have read the “Migrate from Old Storage Configuration” and have made a copy of my files using the new folder structure. I have even upgraded to 1.132.3, as I read about the change with TypeORM, but forgot to create another Database backup at that point. Then I have removed the Immich app and installed a fresh one on the latest version 2.6.3, and it is not up and running, and it detects the files in the “storage usage,” but since the database is new, there are no users, and my admin user shows no files.

When I try to restore the backup, it throws an error “ERROR: DROP DATABASE cannot run inside a transaction block” and I am not sure how to proceed.

Can anyone help me save my Immich? I have the old files and pgData folder backed up; I just need a way to restore the database.

I also have a snapshot of the pool before I started the process, so maybe just rollback to that snapshot and start over?

what helped me tackle my challenges is to restore on a different /new dataset + using a 2nd temp. App. So you can play trough any scenarios without ‘damaging’ your backup/snapshots giving you all the time in the world for troubleshooting. Also have a look in my guide, it may have some good pointers: Immich Disaster Recover Guide for TrueNas Scale – “Common Mistakes and How to Avoid Them” – MRi-LE Selfhosted

Hey,

Thank you for the response. Your guide is very good, and I believe I managed to restore the database. If I do SELECT * FROM users; I can see the old users. The problem now is that the Immich server can not start; it throws

Error: Invalid upgrade path. For more information, see https://docs.immich.app/errors/#typeorm-upgrade`

I am guessing it is because the database dump is from before version 1.132.3, and on the recommended page it says “perform an intermediate upgrade to v1.132.3 first` but I can not do that using the TrueNAS Scale Apps unless I convert it to a custom app and downgrade manually, then do another database dump and repeat the process.

Alright, I have some progress. Managed to get Immich 1.132.3 up and running with a restored database and files. I tried creating a DB dump and restoring it in a separate Immich instance running the latest version, but I got the TypeORM error again.

Now I am trying to upgrade from 1.132.3 to 1.137.0 where the TypeORM is removed according to the docs but now I am getting:

Error: The VectorChord extension version is 0.5.3, but Immich only supports >=0.3 <0.5.

Even though I am using ghcr.io/immich-app/postgres:15-vectorchord0.3.0-pgvectors0.3.0 image for the database.

Can anyone help with this one?