Photos guide
How to Back Up Immich Without Losing Faces, Albums, or Photos
Build and test a complete Immich backup covering its database, media assets, configuration, secrets, and a real restore drill.
Published and reviewed by OpenAlt · September 22, 2026

An Immich backup is complete only when it preserves the database, original media, and configuration needed to reconnect them. Export the database, copy every referenced photo and video, protect secrets, keep an off-host copy, and perform a restore drill before relying on the plan. Immich’s backup documentation separates the database and media responsibilities clearly.
Table of Contents
- What complete means
- Inventory database and asset paths
- Database dump
- Media copy
- Configuration and secrets
- A practical 3-2-1 plan
- Restore drill
- Upgrade checkpoint
- Common failure modes
- Final preflight and next step
- Frequently Asked Questions
What complete means
A complete Immich backup contains four recovery layers:
- The database, including albums, asset metadata, faces, people, sharing relationships, and application state.
- Original photos and videos at paths Immich can read after restoration.
- Generated or related files, sidecars, and additional library data required by your layout.
- Deployment state, including compose files, environment settings, mounts, and secrets.
A database dump alone cannot restore the original media. A media copy without its matching database may preserve files but lose albums, faces, and relationships. The tradeoff is storage and time: database-only backups are smaller, while complete copies take longer but protect the library itself.
Inventory database and asset paths
Document every path before copying anything. Record the database service or location, upload and library directories, external libraries, custom locations, generated-file directories, Docker bind mounts, named volumes, permissions, compose files, environment files, and secret-storage locations.
Storage templates and mount choices affect how Immich finds files after restoration. The official storage-layout notes explain why file arrangement matters. The custom-locations guide covers additional path and mount considerations.
Use this preflight checklist:
- Database and asset paths are documented.
- Custom libraries are included.
- Mounts resolve to the intended host directories.
- The backup destination has enough capacity.
- A separate copy and restore target exist.
Database dump
Create a logical database dump before copying media or upgrading Immich. Use the database tooling supported by your deployment, and store the export outside the live database volume.
The workflow is:
- Confirm the database service is healthy.
- Create the dump with the supported export command.
- Write it to a protected backup directory.
- Confirm the command completed successfully.
- Record its timestamp and matching deployment state.
- Copy it to another storage location.
Do not assume that copying a database directory while its service is running is equivalent to a consistent export. A logical dump provides a distinct recovery artifact that can be imported into a replacement database.
Check the resulting file:
test -r /path/to/immich-database.dump
ls -lh /path/to/immich-database.dump
sha256sum /path/to/immich-database.dump
Replace the path with the location from your inventory. Verify readability, nonzero size, the recorded checksum, and successful import during a restore drill. Review Immich’s backup and restore documentation before standardizing the exact command sequence.
Media copy
Copy original media separately from the database dump. Include every directory Immich uses to read photos and videos, including external libraries and custom locations. Do not copy only thumbnails and assume originals can be reconstructed.
Preserve directory structure, filenames, timestamps where relevant, and readable permissions. If media is split across custom paths, either copy each source or ensure the restored host provides the same path and mount relationship.
Compare source and destination after the copy:
du -sh /source/library /backup/library
find /source/library -type f | wc -l
find /backup/library -type f | wc -l
Counts and sizes are useful signals, not proof. Investigate differences caused by active uploads, excluded files, permissions, or a changing source. A quiet copy window makes verification more meaningful. Preserve the storage-template and custom-location design deliberately; Immich’s storage documentation and custom-location guidance provide the relevant layout details.
Configuration and secrets
Preserve the compose configuration, environment settings, mount definitions, and secret values needed for the restored services to reconnect to the database and media.
Restrict access to this material, keep it out of public repositories, and document where the authoritative copy lives. If secrets change, update the backup set and record which configuration matches each database dump.
From the deployment directory, verify the configuration:
test -r /path/to/compose.yaml
test -r /path/to/.env
docker compose config
Review the rendered result for missing variables, incorrect paths, or unintended mounts. A successful parse confirms that the deployment definition is usable, not that the application has been restored.


A practical 3-2-1 plan
Use the 3-2-1 pattern as a general resilience framework: keep three copies, on two storage types, with one copy off-site.
A practical arrangement is:
- The live Immich database and media.
- A local backup on separate storage.
- An off-site or isolated copy containing the dump, media, and required configuration.
An off-site copy can be stale, while a local copy may share the same failure domain as the original. Record when each copy was created and how it was verified.
Restore drill
A restore drill proves that the backup can recover the library. Use an isolated environment or replacement host so the test cannot overwrite production.
- Prepare a clean target with the required storage paths.
- Restore the deployment configuration and secrets.
- Restore the database dump using the documented procedure.
- Restore original media and required related directories.
- Recreate expected mounts and permissions.
- Start the services according to the deployment documentation.
- Check for database or storage errors.
- Open representative albums, photos, and videos.
- Verify people, faces, dates, and custom locations.
- Record adjustments and recovery time.
The important test is relational: albums should contain their assets, face data should correspond to people, and assets should resolve to readable originals. A directory listing alone cannot prove those relationships. If a path or secret is missing, update the inventory before declaring the backup successful. Use the official restore instructions for the exact import sequence.
Upgrade checkpoint
Create a fresh, matched backup set before every upgrade that may change application or database state. Keep the pre-upgrade dump, current media copy, compose configuration, environment settings, and mount layout together.
Before updating:
- Confirm the backup completed.
- Confirm the media copy is readable.
- Record current image references and paths.
- Identify the rollback candidate.
If the upgrade fails, stop making changes and restore the known-good configuration, database, and media paths as one set. Check Immich’s upgrade documentation for upgrade-specific requirements.
Common failure modes
- Database-only backup: metadata returns, but photos and videos are absent.
- Missing custom location: referenced assets have no available mount.
- Wrong directory layout: files exist but are not found at expected paths.
- Live-copy inconsistency: active uploads change during the copy.
- Unprotected or mismatched secrets: the deployment cannot reconnect safely.
- No restore drill: the first emergency becomes the test.
- Stale off-site copy: recent uploads are missing.
- Unrecorded configuration: nobody knows which paths matched the dump.
For each failure, record the detection signal and corrective action. That turns a collection of files into an operational runbook.
Final preflight and next step
The plan is ready when the database dump imports, the media copy compares successfully, the configuration recreates expected mounts, and a test restore shows albums, faces, and original files together.
Keep this information beside the backup:
- Backup date and scope.
- Dump location and checksum.
- Included media and custom-location mappings.
- Configuration and secret-storage instructions.
- Restore steps and last successful drill.
- Upgrade checkpoint and rollback candidate.
For deployment context, review Immich on OpenAlt, follow the Immich setup guide, and explore the photo directory. Compare the matching OpenAlt project page with your inventory before trusting the next backup.
Frequently Asked Questions
Are database backups enough?
No. They preserve application records but not photos or videos. Keep the dump together with a verified copy of every referenced asset path. Immich’s backup documentation states this distinction directly.
Can snapshots replace dumps?
No. Snapshots can add another recovery layer, but they should not replace a documented database export and verified media copy. Know what each snapshot contains and how it maps to the deployment.
How often should backups run?
Set the schedule according to how quickly the library and metadata change. Active uploads require a shorter recovery-point gap. Always create a fresh checkpoint before upgrades or risky maintenance.
How do you test a restore?
Restore the database, configuration, mounts, and media into an isolated target. Verify albums, people, faces, representative photos, videos, and custom locations, then record and correct any failure.
Should configuration and secrets be backed up?
Yes. Preserve the compose files, environment settings, mount definitions, and required secrets with restricted access. The matching configuration is needed to reconnect the restored database and media.