#Unable to restore Immich from Postgres backup

1 messages · Page 1 of 1 (latest)

haughty shoal
#

Hello! I am unable to restore from backup even after following the guide here: https://immich.app/docs/administration/backup-and-restore

I was using the db dumper and restoring the latest using the given command however it is giving the following error:

psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "Playroom5023" does not exist

I have ensured that Playroom5023 is indeed the db username in the env. I also replaced it and tried with postgres and immich (name of the database) only to have the same errors. Here is my docker compose:

shut eagleBOT
#

:wave: Hey @haughty shoal,

Thanks for reaching out to us. Please follow the recommended actions below; this will help us be more effective in our support effort and leave more time for building Immich immich.

References

Checklist

  1. :ballot_box_with_check: I have verified I'm on the latest release(note that mobile app releases may take some time).
  2. :ballot_box_with_check: I have read applicable release notes.
  3. :ballot_box_with_check: I have reviewed the FAQs for known issues.
  4. :ballot_box_with_check: I have reviewed Github for known issues.
  5. :ballot_box_with_check: I have tried accessing Immich via local ip (without a custom reverse proxy).
  6. :ballot_box_with_check: I have uploaded the relevant logs, docker compose, and .env files, making sure to use code formatting.
  7. :ballot_box_with_check: I have 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)

If this ticket can be closed you can use the /close command, and re-open it later if needed.

haughty shoal
#

Here is the env file:

shut eagleBOT
grand tinsel
#

Can you post the command you're using?

haughty shoal
# grand tinsel Can you post the command you're using?

Apologies completely forgot about that.

| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
| sudo docker exec -i immich_postgres psql --username=Playroom5023```
#

its more or less the same as the one in the docs

shadow python
#

If you’re restoring a backup with a username that you set yourself, that DB won’t exist anymore… because that info is in the backup

#

You can add --dbname=postgres to the psql command to restore

haughty shoal
#

The images are in the exact same place they were in the previous installation (the upload location and directories werent changed at all)

haughty shoal
#

Anyone have any idea as to why this isn't working?