#No images after migration to new data structure

1 messages · Page 1 of 1 (latest)

undone hollow
#

Good Morning everyone,
I have been trying to update and migrate to the new storage structure but i've encountered some issues.
I have it running Truenas CE 25.04. I worked with the old storage structure with the an older version. I then followed the instructions shown on the truenas immich app user interface. I created a new dataset "immich2" with the sub datasets "data" and "postgress-data". I then used resync to copy all the contents to the corresponding new folders i created inside the "data" dataset.

I have 2 issues:

  1. the new immich version shows me the size of all my data which is correct. But I do not have any images anywhere.
    I tried all sorts of things but it seems i cant get it to reindex /analyze the data.

  2. upon doing a rollback to a previous version, i cant get the app to run on my old storage configuration either. Then I get the error attached in the image.

If there is a way to solve 1. then 2. is obsolete and could be ignored.
Do you have a tipp on how to solve this?

alpine lynxBOT
#

:wave: Hey @undone hollow,

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

#

Checklist

I have...

  1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
  2. :ballot_box_with_check: read applicable release notes.
  3. :ballot_box_with_check: reviewed the FAQs for known issues.
  4. :ballot_box_with_check: reviewed Github for known issues.
  5. :ballot_box_with_check: 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.

cedar peak
#

can you share the content of the 2 sub datasets?

#

as well as the permissions set on them?

cedar peak
undone hollow
#

/mnt/DataStore/immich2/data

drwxrwx--- 8 apps apps  8 Oct 24 17:58 ./
drwxrwx--- 4 root root  4 Oct 24 17:53 ../
drwxrwx--- 2 apps apps 17 Oct 25 11:00 backups/
drwxrwx--- 3 apps apps  4 Oct 24 20:19 encoded-video/
drwxrwx--- 4 apps apps  5 Oct 24 20:08 library/
drwxrwx--- 2 apps apps  3 Oct 24 20:20 profile/
drwxrwx--- 3 apps apps  4 Oct 24 20:27 thumbs/
drwxrwx--- 3 apps apps  4 Oct 24 18:22 upload/

#
truenas_admin@nas[~]$ ls -alF /mnt/DataStore/immich2/postgress-data 
total 70
drwx------ 20 netdata docker    27 Oct 25 11:43 ./
drwxrwx---  4 root    root       4 Oct 24 17:53 ../
-rwxrwx---  1 netdata docker     3 Oct 24 19:12 PG_VERSION*
drwxrwx---  7 netdata docker     7 Oct 24 19:12 base/
drwxrwx---  2 netdata docker    63 Oct 25 11:44 global/
drwxrwx---  2 netdata docker     2 Oct 24 19:12 pg_commit_ts/
drwxrwx---  2 netdata docker     2 Oct 24 19:12 pg_dynshmem/
-rw-------  1 netdata docker  4821 Oct 24 19:12 pg_hba.conf
-rw-------  1 netdata docker  1636 Oct 24 19:12 pg_ident.conf
drwxrwx---  4 netdata docker     5 Oct 25 15:48 pg_logical/
drwxrwx---  4 netdata docker     4 Oct 24 19:12 pg_multixact/
drwxrwx---  2 netdata docker     2 Oct 24 19:12 pg_notify/
drwxrwx---  2 netdata docker     2 Oct 24 19:12 pg_replslot/
drwxrwx---  2 netdata docker     2 Oct 24 19:12 pg_serial/
drwxrwx---  2 netdata docker     2 Oct 24 19:12 pg_snapshots/
drwxrwx---  2 netdata docker     2 Oct 25 11:43 pg_stat/
drwxrwx---  2 netdata docker     2 Oct 24 19:12 pg_stat_tmp/
drwxrwx---  2 netdata docker     3 Oct 24 19:12 pg_subtrans/
drwxrwx---  2 netdata docker     2 Oct 24 19:12 pg_tblspc/
drwxrwx---  2 netdata docker     2 Oct 24 19:12 pg_twophase/
drwxrwx---  4 netdata docker     5 Oct 24 19:12 pg_vectors/
drwxrwx---  3 netdata docker    12 Oct 24 19:44 pg_wal/
drwxrwx---  2 netdata docker     3 Oct 24 19:12 pg_xact/
-rw-------  1 netdata docker    88 Oct 24 19:12 postgresql.auto.conf
-rw-------  1 netdata docker 29541 Oct 24 19:12 postgresql.conf
-rwxrwx---  1 netdata docker    87 Oct 25 11:43 postmaster.opts*
-rwxrwx---  1 netdata docker    94 Oct 25 11:43 postmaster.pid*
cedar peak
#

can you show also the contetn of backups/

#

And you did not share the permissions of the datasets

#

Permission is smth like this

#

on the dataset page

#

And by no image, what do you mean exactly?

cedar peak
#

sry for not being the most responsive today

undone hollow
#

Dont worry, me neither. Sorry for being so vague with the details.
Data:

#

Backups folder content:

 ls backups 
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls -la backups 
total 1056549
drwxrwx--- 2 apps apps       17 Oct 25 11:00 .
drwxrwx--- 8 apps apps        8 Oct 24 17:58 ..
-rwxrwx--- 1 apps apps       13 Oct 25 11:43 .immich
-rwxrwx--- 1 apps apps 81871955 Sep 19 11:00 immich-db-backup-20250919T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81872877 Sep 20 11:00 immich-db-backup-20250920T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81872576 Sep 21 11:00 immich-db-backup-20250921T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81873143 Sep 22 11:00 immich-db-backup-20250922T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81871890 Sep 23 11:00 immich-db-backup-20250923T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81872104 Sep 24 11:00 immich-db-backup-20250924T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81873503 Sep 25 11:00 immich-db-backup-20250925T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81873490 Sep 26 11:00 immich-db-backup-20250926T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81849846 Oct 20 11:00 immich-db-backup-20251020T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81850232 Oct 21 11:00 immich-db-backup-20251021T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81850412 Oct 22 11:00 immich-db-backup-20251022T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81851735 Oct 23 11:00 immich-db-backup-20251023T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 apps apps 81852142 Oct 24 11:00 immich-db-backup-20251024T020000-v1.137.3-pg15.13.sql.gz
-rwxrwx--- 1 root apps 16616334 Oct 25 11:00 immich-db-backup-20251025T020000-v2.1.0-pg15.14.sql.gz

#

By no no images i mean that none of my pictures are being recognized by immich.

#

And i just now saw that only the backups folder contains an .immich file. All the others folders are empty.

cedar peak
#

Do you still have the orignal immich dataset somewhere?

undone hollow
#
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls thumbs 
a1d79463-6ec7-4483-bd7b-0c93c41b0a6f
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls upload 
a1d79463-6ec7-4483-bd7b-0c93c41b0a6f
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls profile
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls profile 
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls library 
library  profile
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls encoded-video 
a1d79463-6ec7-4483-bd7b-0c93c41b0a6f
truenas_admin@nas[/mnt/DataStore/immich2/data]$     

cedar peak
#

ooh ok, so not that empty

#

alleluia lol

undone hollow
cedar peak
#

ok so from the path your currently at now
sudo mv library/profile/* profile/
sudo mv library/library/* library/

#

this way you'll move the data at the right place (for this part)

#

Then you'll have to stop the immich app

#

(well you can already stop it now)

cedar peak
#

Ooh so both are empty

undone hollow
#

yes

cedar peak
#

ok, so do ls -la on all directories

#

to check if they at least contain the .immich file

#

sudo rmdir library/library
sudo rmdir library/profile

#

to remove the 2 empty (and thus useless folders)

undone hollow
#
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls -la library 
total 11
drwxrwx--- 4 apps apps  5 Oct 24 20:08 .
drwxrwx--- 8 apps apps  8 Oct 24 17:58 ..
-rwxrwx--- 1 apps apps 13 Oct 25 11:43 .immich
drwxrwx--- 2 apps apps  2 Oct 24 20:08 library
drwxrwx--- 2 apps apps  3 Jan 31  2025 profile
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls -la library/library 
total 1
drwxrwx--- 2 apps apps 2 Oct 24 20:08 .
drwxrwx--- 4 apps apps 5 Oct 24 20:08 ..
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls -la library/profile 
total 2
drwxrwx--- 2 apps apps  3 Jan 31  2025 .
drwxrwx--- 4 apps apps  5 Oct 24 20:08 ..
-rwxrwx--- 1 apps apps 13 Oct 23 11:47 .immich
cedar peak
#

ok so you can delete them

#

what about ls -la profile

undone hollow
#
truenas_admin@nas[/mnt/DataStore/immich2/data]$ ls -la profile 
total 10
drwxrwx--- 2 apps apps  3 Oct 25 20:17 .
drwxrwx--- 8 apps apps  8 Oct 24 17:58 ..
-rwxrwx--- 1 apps apps 13 Oct 25 11:43 .immich


```
cedar peak
#

ok so all files are at the right place
you can just delete library/profile and library/library

undone hollow
#

done

cedar peak
#

OK, so now we're going to restore the database from the last (working) backup
Is your app stopped?

undone hollow
#

yes

#

Just a question, would a voice call be more convenient?

cedar peak
#

Well I'm doing 2 things at the same time so not really for me

undone hollow
#

sounds good

cedar peak
#

ok so first remove immich postgres data
rm -r /mnt/DataStore/immich2/postgress-data/*

undone hollow
#

done

cedar peak
#

edit the Immich app
There you can add an additional env variable
there is a button for it
Click on add. The variable is
DB_SKIP_MIGRATIONS
and value should be
true

undone hollow
#

done

cedar peak
#

Now, start the immich app (it won't work)

undone hollow
#

yes

#

it looks like a restarting loop

cedar peak
#

Now with the terminal
sudo su
then
gunzip --stdout "/mnt/DataStore/immich2/data/backups/immich-db-backup-20251024T020000-v1.137.3-pg15.13.sql.gz" | sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" | docker exec -i ix-immich-pgvecto-1 psql --dbname=postgres --username=immich

cedar peak
undone hollow
#

should I stop the app before execution?

cedar peak
#

No, you need the app not running

#

well the ix-immich-pgvecto-1 container

#

so it has to be running

undone hollow
#

Error response from daemon: Container 31f054a526d6cc88f30ea164aea0b1de69c5d2949c0aabea1fa7c99b8b141ba3 is restarting, wait until the container is running

cedar peak
#

Do you have multiple immich app running ?

#

can you show where you added the env var?

undone hollow
undone hollow
#

Error response from daemon: No such container: ix-immich-pgvecto-1

cedar peak
#

can you do
sudo docker ps

#

and share outpu

undone hollow
#
2af4b5b3f05d   ghcr.io/immich-app/immich-server:v2.1.0                                                "tini -- /bin/bash -…"   About a minute ago   Restarting (1) 1 second ago                                                                      ix-immich2-server-1
005e1db31c03   ghcr.io/immich-app/postgres:15-vectorchord0.4.3-pgvectors0.2.0                         "/usr/local/bin/immi…"   About a minute ago   Up About a minute (healthy)   5432/tcp                                                           ix-immich2-pgvecto-1
3e70e974b6ef   ghcr.io/immich-app/immich-machine-learning:v2.1.0                                      "tini -- python -m i…"   About a minute ago   Up About a minute (healthy)                                                                      ix-immich2-machine-learning-1
65af7301ace3   valkey/valkey:9.0.0                                                                    "docker-entrypoint.s…"   About a minute ago   Up About a minute (healthy)   6379/tcp                                                           ix-immich2-redis-1

probably ix-immich2-pgvecto-1 ?

cedar peak
#

yes

cedar peak
undone hollow
#

done

cedar peak
#

start it again?

#

and try to access it

#

if not already running

undone hollow
#

yepp i can see i believe everything again!!

#

Thank you so much!

cedar peak
#

nice, no problem!

undone hollow
#

Can I donate or support you guys somehow ?
I would love to!

cedar peak
undone hollow
#

Thanks man!
Have a nice evening & weekend!
Enjoy!

cedar peak
#

You too!
Thanks

#

You can /close this thread

undone hollow
#

/close