Trouble upgrading to IMMICH 2.4 through TRUENAS applications UI

Hi everyone,

this is my first post here, I tried to use the search to find a similar topic but I could not find any. I apologize if there is a solution available already though.

#Issue
At the beginning of this year I set up a little home server running truenas and I installed Immich through the truenas applications UI.

It has been working fine so far and I have kept it up to date up to version 2.1.0, however the last update to 2.4.1 broke the database. I assume i should have migrated the database from Postgres 15 ot 18 while still on 2.10, however I didn’t.

My presumably fatal mistake took place when reverting, however, I didn’t really think and just picked the first option that truenas showed me. Apparently this was the first version of the database it had available as backup and not the latest before the upgrade so it reverted back to version 1.4.
Naturaly I would like to go to the latest version before the breaking update, however, truenas now only offers the option to go the the 2.4. version which will break again now with the following error on the pgvecto_upgrade container:

ERROR: Target version directory [/var/lib/postgresql/15/docker] already exists and is not empty, but PG_VERSION file not found.
This may indicate a partial/failed upgrade. Please investigate and remove/rename the existing directory.

With the normal UI methods I have apparently no way to choose to manually upgrade to each successive version. It seems there is a possibility to do this via a docker compose, since I have not done this yet I was trying to look into where to locate and change a docker compose for Truenas Applications. I didin’t really finde anythign that was immediatly helpful to me. Could someone explain if and how this would be possible or maybe point to an existing guide for this? I would be very thankful.

I do have weekly rsync backups to a cold storage of may data and database, so I’m not that afraid of loosing acutal data. I have also a running new immich version already with an empty database. I would of course re-immigrate the old data, but I would like to learn how to fix this stuff manually if possible, instead of doing it the wrong way around.

Another question would be, since I have database backups, is it possibly to import these to the new database somehow? Otherwise the backup would be kind of pointless, wouldn’t it?

Again, I would be very thankful for any help or pointers into the right direction.

Hope you all have a wonderful christmas time,

Cheers, Weggla

I dont see any breaking changes for the versions 2.x but maybe I’m missing something.

Thanks for the link, I looked into it before but didnt get any wiser, since I am at the moment sill looking how to get to the truenas docker compose file for apps installed through the applications ui, it shows up in portainer but at the moment I still have a steep learning curve ahead of me decyphering what I am seeing all means.

Additionally I have to make a correction, the versions i reverted back to are:

App Version: v1.140.1
Version: v1.9.23

In general I am a bit confused why there are two different versions, but I assume it hast to do with the truenas configuration for the Applications. The Database itself is still working after I reverted back to that version. but as mentioned above I was unable to upgrade with the correpsonding error message.

I am still looking into other sources, but I am quite out of my depth here. I will give updates if I makre any progress for reference to other for the future. In the meantime any other suggestions are still welcome.

Some info is lacking on how exactly you did the installation in the first place as well as the upgrade. I assume you use the docker compose setup and then just replaced with the new compose file? In principle immich instructions say to just change the immich version in the compose file you were using, if I remember correctly. Unless the release notes state otherwise (which they did a few times in the past year i believe).

I’m guessing your issue is caused by the Postgres upgrade to 18 which had some breaking changes so I’d start looking there. Look into upgrade guides for the db and valley as well if you are upgrading those at the same time.

I am not sure how to provide more infromation on how I installed it.

When I say truenas applications UI, I mean the trueNAS built in applications “repository” feature for lack of a better word. So you just select an application you want to run on trueNAS, and the have preconfigured scripts to install an run it, you just specify the dataset locations and some mandatory variables you want it to use.
As such, I did not write / update the compose files myself but that is handled by trueNAS in the background and therefor I am currently looking into how I can access these compose files. I used the built-in applications system because of “convenience” but as happens so often, that comes now back to bite me.

I agree with you that the Postgres upgrade seems to be the problem. I remember a video wendell posted a while back creating compose files manually within portainer I will look into that.
I should have gone down that route in the first place for more control :slight_smile: