Pre‑requirements
- Immich version: Install the latest Immich as per the official GitHub Releases.
- Database dump: Have a
.sql.gzdump ready of the current and latest Immich version. - Full master backup: A full backup of your Immich <MASTER_DIR> as per The 3-2-1 Backup Method. Example master folder path:
/volume1/docker/immich. - SSH access: We will use the command line.
- Version match: Ensure the Postgres version used for the dump matches the version in your new database container. Don’t import a dump from a newer Immich/Postgres into an older one (or vice versa).
- I cannot guarantee this works for you, this manual is based on a standard clean docker immich install, installed on the same machine and volume
- No support for HELM Charts
NOTE
Fresh database required For a clean restore, the database must be fresh (the Immich server must not have run since the containers were created). If it has, you may hit conflicts (e.g., relation already exists, FK violations, multiple PKs). In that case, reset by deleting the contents of the
dbdata directory.
TIP
Skip server migrations temporarily If your deployment always starts the server along with the DB, set
DB_SKIP_MIGRATIONS=truebefore starting services. This prevents migrations that interfere with the restore. Remove this variable and restart after the restore is complete.
Database
WARNING
Immich saves file paths in the database, it does not scan the library folder to update the database so backups are crucial.
INFO
Refer to the official postgres documentation for details about backing up and restoring a postgres database.
No monitoring of integrity on automatic database dumps.
It is not recommended to directly backup the
<DB_DATA_DIR>folder. Doing so while the database is running can lead to a corrupted backup that cannot be restored. Instead, use the automatic database dumps for backup and restore. When restoring you will start with an empty DB folder anyway.
Automatic Database Dumps
WARNING
The automatic database dumps can be used to restore the database in the event of damage to the Postgres database files. There is no monitoring for these dumps and you will not be notified if they are unsuccessful.
DANGER
The database dumps do NOT contain any pictures or videos, only metadata. They are only usable with a copy of the other files in
UPLOAD_LOCATIONas outlined below.
Next steps
TIP
References and sources: