Does anyone knows how to restore a immich-db-backup-12345.sql.gz dump-file to the immich app?
My immich-app is not starting any more. After giving the app a new dataset for the Postgres Data Storage, I can start up the app again, but it’s like a fresh instillation.
I have a dump.sql.gz from the database from yesterday.
Here are the infos for Restore from the immich docs
docker compose down -v # CAUTION! Deletes all Immich data to start from scratch
## Uncomment the next line and replace DB_DATA_LOCATION with your Postgres path to permanently reset the Postgres database
# rm -rf DB_DATA_LOCATION # CAUTION! Deletes all Immich data to start from scratch
docker compose pull # Update to latest version of Immich (if desired)
docker compose create # Create Docker containers for Immich apps without running them
docker start immich_postgres # Start Postgres server
sleep 10 # Wait for Postgres server to start up
# Check the database user if you deviated from the default
gunzip < "/path/to/backup/dump.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 immich_postgres psql --username=postgres # Restore Backup
docker compose up -d # Start remainder of Immich apps
I installed now a new instance of immich on dockge and tried to restore the backup.
I get the following error:
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory. Is the server running locally and accepting connection on that socket?
Maybe somebody has a hint for me to restore the backup.
currently doing a Backup/Restore Test using TrueNasScale setting up another instance of immich for the recover. however i run into the following issue from the db restore
sudo gunzip --stdout "/mnt/WD16TB/TN-App-Backup/immich-db-backup-20250923T020000-v1.142.1-pg15.14.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-foto-2-pgvecto-1 psql --dbname=postgres --username=immich # Restore Backup
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.47/containers/ix-immich-foto-2-pgvecto-1/json": dial unix /var/run/docker.sock: connect: permission denied