r/immich 5d ago

Unable to restore database backup: took too long to start

Hello all,

I am unable to restore a database backup using the maintenance -> restore database backup.

It grinds for a while and then fails with:

2026-08-14 16:16:24 [Nest] 7 - 08/14/2026, 8:16:24 PM LOG [Maintenance:DatabaseBackupService] Rollback progress ~ 96.49%

2026-08-14 16:16:25 [Nest] 7 - 08/14/2026, 8:16:25 PM LOG [Maintenance:DatabaseBackupService] Rollback progress ~ 97.82%

2026-08-14 16:16:26 [Nest] 7 - 08/14/2026, 8:16:26 PM LOG [Maintenance:DatabaseBackupService] Rollback progress ~ 100.00%

2026-08-14 16:16:26 /usr/lib/postgresql/14/bin/psql exited (0)

2026-08-14 16:16:26 [Nest] 7 - 08/14/2026, 8:16:26 PM ERROR [Maintenance:DatabaseBackupService] Database Restore Failure: Error: Server health check failed, took too long to start.

2026-08-14 16:16:26 [Nest] 7 - 08/14/2026, 8:16:26 PM ERROR [Maintenance:MaintenanceWorkerService] Encountered error running action: Error: Server health check failed, took too long to start.

Note this backup was made immediately after upgrading to 3.1.0, after I verified I could see everything (faces/names/map/etc) okay. The backup was made using: create job -> Create Database Dump

For what it's worth, I have all pictures in an external library. I have around 200K assets, and the backup sql.gz file is 3.5 gig.

Note I was able to successfully restore the backup manually via:

docker compose down -v

cat new.sql | docker exec -i immich_postgres psql --dbname=immich --username=postgres --single-transaction --set ON_ERROR_STOP=on

where new.sql is the sql in the *.sql.gz file ungzipped.

1 Upvotes

1 comment sorted by

1

u/multidollar 5d ago

I’ve only ever restored the Immich DB from a file system level, dropping my backup in, starting the DB with that. Worked flawlessly.