DB Restore ERROR

i get var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "postgres" does not exist wehn trying to restore the database. any suggestions ?
15 Replies
Alex Tran
Alex Tranβ€’2y ago
Can you outline the exact steps that you were using?
noneedforaname
noneedforanameOPβ€’2y ago
hi alex .. i just managed to use the user outlined in the stack yaml environment: - TZ=Europe/Vienna - POSTGRES_DB=immich - POSTGRES_USER=immichuser - POSTGRES_PASSWORD=immichpw when i add the user immichuser at the end :gunzip < β€œ/volume1/docker/immich/Immich-DB.sql.gz” | docker exec -i Immich-DB psql -U immichuser -d immich # Restore Backup it does not throw this error .. now i have -ash: β€œdocker/immich/Immich-DB.sql.gz”: No such file or directory... for me its just rafting in wilkd waters hee πŸ˜‰
Alex Tran
Alex Tranβ€’2y ago
πŸ€”
noneedforaname
noneedforanameOPβ€’2y ago
this was used to backup the database docker exec -t Immich-DB pg_dumpall -c -U postgres | gzip >"/volume1/Heimdall/Documente/immich_Backups/dump.sql.gz" and now im trying to restore it all started with my iphone updating the app automatically to .86 so i needed to upgrade the server ..
Alex Tran
Alex Tranβ€’2y ago
you need to point to this path for the restore file /volume1/Heimdall/Documente/immich_Backups/dump.sql.gz
noneedforaname
noneedforanameOPβ€’2y ago
No description
noneedforaname
noneedforanameOPβ€’2y ago
it is still not restoring
Alex Tran
Alex Tranβ€’2y ago
what is the error message?
noneedforaname
noneedforanameOPβ€’2y ago
no error see picture above .. i enter the gunzip.... and it ends with a blinking >
Alex Tran
Alex Tranβ€’2y ago
Can you follow the guide exactly laid out in this page https://immich.app/docs/administration/backup-and-restore
noneedforaname
noneedforanameOPβ€’2y ago
i think my backup is broken.. i zipped the whold db folder .. is this any help for me ? thanks .. thats what i did i restored the database folder but cannot login on the web ui ..
Inkoma πŸ‡΅πŸ‡Ή
Hi Alex. I see this doc all the time refered, but in my opinion the instructions are not clear. Do we need to restore using the same docker-compose version we did the backup with? Do we need to copy the files to the location prior or after the restore? Sorry, but have tried many times to restore, but always had to do the CLI upload.
Alex Tran
Alex Tranβ€’2y ago
Do we need to restore using the same docker-compose version we did the backup with
I think restoring means to transfer to the same postgres version it would not be a restore process but an upgrade process if you are going to a different version, correct? The file that get dumped is the database information, you restore to a new instance by populating those information from your previous instance does it help answer your questions?
Inkoma πŸ‡΅πŸ‡Ή
It helps indeed. My apologies for my lack of knowledge. Still learning the terms "postgres" and all my linux experience comes from only wanting to install Immich. Will try again to make it work
Alex Tran
Alex Tranβ€’2y ago
No problem man, let me know if we can help with anything

Did you find this page helpful?