Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Data Recovery

How to Back Up a Self-Hosted Photo Gallery So You Don’t Lose Your Pictures

By Freedom251 Team · · 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Back up two separate things: your original photo and video files, and the gallery’s database or index. Keep at least three copies on two different kinds of media, with one copy away from the server or home, and periodically prove that you can restore them. A database export by itself cannot recover missing pictures, while a folder copy without the database can leave albums, faces, captions, and file paths unusable.

The exact directories and restore sequence depend on the gallery, database engine, storage template, and installed release. Use the version-matched documentation for your software before moving data or replacing an installation. The workflow below gives you a complete plan and highlights the differences documented for Immich and PhotoPrism.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a complete gallery backup contains

A self-hosted gallery normally has several layers of data. Treat each layer as a recovery ingredient rather than assuming one “backup” feature covers everything.

Ingredient What it preserves If it is missing
Originals The camera files you uploaded, including photos and videos You cannot recover the actual image or video, even if every album record survives
Database or index File paths, captions, dates, albums, users, permissions, labels, and other catalog information You may have files but lose the organization and metadata that make the gallery useful
Application storage and configuration Settings, sidecars, thumbnails, generated previews, and (for some installations) database files or backup archives The gallery may need a long rescan or regeneration, and settings may have to be rebuilt
Credentials and encryption material Secrets needed to reconnect to an external database, object store, or encrypted backup A technically intact copy may still be inaccessible

Generated thumbnails and transcodes are usually replaceable, but rebuilding them consumes CPU, disk space, and time. Originals and the catalog are the non-negotiable pair; configuration and generated data determine how quickly and faithfully the service comes back.

#1 Best Overall
Sale
WD 2TB Elements Portable External Hard Drive for Windows, USB 3.2 Gen 1/USB 3.0 for PC & Mac, Plug and Play Ready - WDBU6Y0020BBK-WESN
  • High capacity in a small enclosure – The small, lightweight design offers up to 6TB* capacity, making WD Elements portable hard drives the ideal companion for consumers on the go.
  • Plug-and-play expandability
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • SuperSpeed USB 3.2 Gen 1 (5Gbps)

Map your installation before copying anything

Do not start with a guessed path such as a home directory or a container volume. First write down what your particular deployment uses.

Identify the software and release

Record the gallery name, exact installed version, installation method (for example, containers or a native package), and the database type. Recovery instructions can change between releases. Immich specifically notes that older backups may require the documentation for the matching version, including a process change at version 2.5.0. Keep a copy of this version information with the backup set.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Locate originals and moved folders

Find the configured media or originals directory in the application settings, compose file, service definition, or administrator documentation. Note every path that was moved to another disk, mounted from a NAS, or mapped into a container. A backup job that sees only the application directory can silently omit a library stored elsewhere.

Record the database arrangement

Determine whether the gallery uses an embedded database, such as SQLite, or a separate database service. Write down its host, database name, credentials location, and data directory. A separate database service is not automatically included when you copy the gallery’s storage folder.

List irreplaceable extras

  • Original files imported from phones, cameras, and shared folders
  • Sidecar metadata files that you intentionally edit outside the database
  • Custom configuration, reverse-proxy settings, and certificates required to reach the service
  • Encryption keys, API credentials, and the password or key needed to decrypt off-site copies

Keep this inventory in a text file beside the backup, but do not put unencrypted passwords in the same location as an unencrypted archive.

Export the database or index with the gallery’s own method

Use the application’s documented backup or dump process rather than copying a live database file while it is being written. A dump gives you a point-in-time catalog that can be imported during recovery. Check the schedule, destination, compression, encryption, and retention settings after enabling it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
WD 2TB My Passport, Portable External Hard Drive, Black, backup software with defense against ransomware, and password protection, USB 3.1/USB 3.0 compatible - WDBYVG0020BBK-WESN
  • Slim durable design to help take your important files with you
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • Back up smarter with included device management software[2] with defense against ransomware
  • Help secure your important files with password protection and hardware encryption
  • 3-year limited warranty

Immich

Immich stores file paths and user metadata in its database and does not scan the library folder to reconstruct that database. Its official Backup and Restore documentation describes built-in database backups for disaster recovery and explains their scope. Treat the resulting dump as one component of the plan; pair it with a filesystem copy of the configured upload location.

The current documentation describes daily scheduling at 2:00 AM and a default retention of 14 database backups. These are product settings, not universal guarantees: verify the values shown by your installed release, confirm where the files are written, and make sure your separate backup job actually copies that destination.

PhotoPrism

PhotoPrism’s Creating Backups guide defines the minimum as the originals folder plus a copy of the index database. The documented defaults include daily database dumps and retention of up to three SQL dumps, but schedules, dump types, and retention can be changed. Check your own configuration instead of assuming those defaults.

If you run MariaDB or another dedicated database, its data is stored separately from the application storage path. Export that database using the documented procedure and include the resulting dump in the same backup set as the media copy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Copy the originals and the application data

Immich paths and trade-offs

Immich recommends backing up all of UPLOAD_LOCATION as the simplest comprehensive filesystem approach. Its critical original-content locations include the library, upload, and profile directories, although the precise layout depends on the release, storage template, and any folders you relocated. Confirm those paths in the version-matched guide before selecting individual directories.

Backing up only the critical original folders saves space, but it can require rerunning thumbnail and transcoding jobs after a restore. Copying the complete upload location retains more generated material and reduces rebuild time. Either choice is valid when it is deliberate and your capacity and recovery-time goals are clear.

Rank #3
Sale
Aiolo Innovation 500GB External Hard Drive Ultra Slim Portable HDD-USB 3.0 for PC, Mac, Laptop, PS4, Xbox one,Xbox 360 HD-A4
  • Ultra fast data transfers: the external hard drive works with USB 3.0 thickened copper cable to provide super fast transfer speeds. Theoretical read speed is as high as 110MB/s-133MB/s and write speed is as high as 103MB/s.
  • Ultra-thin and quiet: the motherboard adopts a noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
  • Compatibility: compatible with PS4/xbox one/Windows/Linux/Mac/Android,Stable and fast downloading on game console no difference from fast transmission when using on PC.
  • Plug and Play: no software to install, just plug it in and the drive is ready to use. The hard drive chip is wrapped with aluminum anti-interference layer to increase heat dissipation and protect data
  • Package Contents: 1* portable hard drive, 1 *USB 3.0 cable, 1*USB to type C adapter,1 *user manual, shell packaging, three-year manufacturer's warranty and free technical support services

PhotoPrism paths and trade-offs

PhotoPrism separates the originals folder from its storage folder. Storage can contain configuration, database files when SQLite is used, backup archives, thumbnails, and sidecars. The vendor recommends including storage because it preserves settings and generated data; omitting it may force a rescan and regeneration of sidecars and thumbnails.

For an external database, copy the configured storage data that belongs to the application and export the external database separately. The technical behavior of database dumps is described in PhotoPrism’s Backups & Restores documentation. Do not infer that a storage-folder copy contains a MariaDB database located on another host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a copy method that preserves what the gallery needs

Preserve filenames, directory structure, timestamps, permissions, and symbolic links where the platform relies on them. If you use a synchronization tool, configure it to retain older versions rather than mirroring deletions instantly into every destination. Verify that large video files complete without truncation and that the destination reports enough free space.

Build a 3-2-1 plan around your library

Immich’s official guidance recommends a 3-2-1 strategy. In practical terms, aim for three total copies, stored on at least two different media types, with one copy off-site.

Copy Typical location Purpose and cautions
Primary working copy The server’s local disks Fast daily access, but exposed to disk failure, theft, ransomware, and operator mistakes
Local recovery copy A separate external hard drive, SSD, or NAS share Fast restoration after a server failure; disconnect or restrict write access when not actively backing up
Off-site copy Encrypted cloud or a drive stored at another location Protects against fire, theft, and site-wide incidents; account security, encryption, retrieval time, and recurring cost must be planned

Different media means more than three folders on one disk. A second directory on the same drive does not protect against that drive’s failure. Likewise, two snapshots on a continuously mounted share can both be encrypted or deleted by the same compromised account.

Keep history instead of one rolling mirror

Retain multiple dated snapshots where capacity allows. Version history gives you a chance to recover a picture deleted weeks ago or a catalog damaged by a bad import. A mirror that immediately propagates deletions is useful for current-state recovery but is not sufficient for accidental deletion or corruption.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
YOTUO 1TB External Hard Drive, Portable Storage Expansion HDD, USB 3.0 & USB-C for PC, Mac, Desktop, Laptop, Smartphone, PS4, Xbox One, Xbox 360, Office & Game, Black
  • 【Versatile Storage Expansion – For Gaming, Work & Everyday Use】 Running out of space on your PS5 or Xbox Series X/S? This external hard drive lets you store and play PS4 / Xbox One games directly, instantly freeing up your console’s internal storage for next‑gen titles. At the same time, it handles work file backups, media libraries, and cross‑device data transfers with ease. One drive, all your needs. *(Note: PS5 / Xbox Series X|S games cannot be run or stored directly from the external hard drive. However, by offloading your PS4 / Xbox One games, you can free up valuable space for newer titles.)*
  • 【Patented Silicone Sleeve – Data Protection You Can Count On】 Worried about drops? We’ve got you covered. The patented built‑in silicone sleeve acts like a shock‑absorbing armor, cushioning your drive against bumps and falls. Whether it’s important work documents, precious family photos, or hard‑earned game saves, your data deserves this level of protection.
  • 【Plug & Play, Compatible with Computers & Consoles】 No complicated setup—just plug in and go. Works seamlessly with Windows, Mac, and Linux computers, as well as PS4, PS5, Xbox One, and Xbox Series X/S. Process files at the office, back up data at home, or enjoy gaming in your downtime—one drive handles all your devices, simply and hassle‑free.
  • 【USB 3.0 Ultra‑Fast Transfer – No More Waiting】 Tired of watching progress bars crawl? With USB 3.0 speeds up to 5Gbps, large files transfer in seconds. Whether you’re moving work documents, transferring hundreds of gigs of games, or backing up a year’s worth of photos, you get more done in less time.
  • 【Sleek, Lightweight, and Ready to Go】 Weighing just 0.16 kg—lighter than a can of soda—this compact drive features a stylish mirror‑and‑frosted finish. Toss it in your bag and go, whether you’re heading to the office, visiting a friend for a gaming session, or giving a presentation on the road.

Secure the off-site copy

Use encryption appropriate to your threat model, protect the storage account with a unique password and multi-factor authentication, and store recovery keys separately from the encrypted data. Decide who can retrieve the archive and how long a large download would take before an emergency occurs.

Keep the database and media copies coherent

The catalog contains paths and metadata that must correspond to files on disk. If you export the database at noon and copy a library that is still changing until midnight, the two copies may describe different states. The mismatch can appear as missing files, stale albums, or newly imported media absent from the restored index.

Choose a repeatable window for the dump and filesystem copy. If your platform documents a maintenance or read-only mode, use it during that window; otherwise pause imports and background jobs according to the platform’s instructions. Record the start and end time of each component in a small manifest. When a backup spans several hours, note which changes may fall outside the shared point in time.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A practical backup workflow

  1. Inventory the installation. Record the software and version, originals or upload path, storage path, database type, external mounts, and encryption credentials.
  2. Create a database or index dump. Use the gallery’s documented interface or procedure. Confirm the dump completed and note its location and timestamp.
  3. Copy original photos and videos. Include every configured media directory, including folders on other disks or network mounts. Verify file counts and a sample of large videos.
  4. Include required application data. Copy configuration, sidecars, thumbnails, and other storage data when they shorten recovery or preserve settings. Follow the platform’s guidance on optional generated folders.
  5. Make additional copies. Place the set on separate local media and in an off-site location. Encrypt the off-site copy and protect its account.
  6. Retain older snapshots. Keep enough history to cover delayed discovery of deletion, corruption, or ransomware. Ensure the retention policy applies to both the database dumps and the media snapshots.
  7. Run a restore drill. Restore into a separate directory, machine, virtual machine, or test instance. Open representative photos and videos, inspect albums and metadata, and confirm the application can use the restored paths.
  8. Revisit after changes. Repeat the inventory whenever you upgrade the gallery, move storage, change database engines, alter upload paths, or add a new mount.

This is a planning workflow, not a universal command sequence. Container volume names, service accounts, database tools, and restore commands vary by release; use the official procedure for your installation at each step.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Restore and test before a disaster

Immich restore checks

Immich expects the relevant storage files to be present and accessible during a restore. Its guide advises checking storage-folder integrity and accessibility before importing the database. After the catalog is restored, confirm that the paths recorded in the database resolve to the mounted files. If you selected only critical original folders, plan for thumbnail and transcoding jobs to run again.

Use the documentation that matches the backup’s Immich version, especially for backups made before the process change noted at version 2.5.0. Do not overwrite a working installation until the test restore has demonstrated that the database and files belong together.

Best Value
WD 4TB My Passport, Portable External Hard Drive, Black, Backup Software with Defense Against ransomware, and Password Protection, USB 3.1/USB 3.0 Compatible - WDBPKJ0040BBK-WESN
  • Slim durable design to help take your important files with you
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • Back up smarter with included device management software[2] with defense against ransomware
  • Help secure your important files with password protection and hardware encryption
  • 3-year limited warranty

PhotoPrism restore checks

PhotoPrism’s Restoring Backups guide recommends restoring originals and then the database for an external-database setup. It also advises trying a dump on a separate test instance before replacing an existing index. Follow that order and adapt it to the database type documented for your deployment.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After the service starts, check more than whether the login page loads:

  • Open photos from different years and folders, including at least one large video.
  • Confirm albums, captions, dates, labels, and user access match expectations.
  • Look for missing-file warnings and verify that the application can read the restored originals.
  • Trigger or observe any required thumbnail, sidecar, or transcoding regeneration.
  • Measure how long the drill takes and record storage needed for generated data.

A successful test restore is evidence that the procedure works with your paths and credentials. Merely seeing a completed backup job is not.

Common backup failures and their fixes

Symptom Likely cause Fix
The gallery opens but pictures are missing The database was saved without the originals, or a mount was absent Locate every configured media path and restore the matching filesystem copy before importing the catalog again
Pictures exist but albums and metadata are gone Only the originals folder was copied Restore the database or index dump from a known point in time
Everything is present but thumbnails are blank Generated storage was excluded or is incompatible with the restored release Restore the storage data when available, or allow the documented regeneration jobs to rebuild it
A database dump cannot be imported Wrong database type, credentials, version, or dump format Match the restore instructions to the software release and database engine; test on an isolated instance
Recent uploads are absent The media copy and database dump came from different times Use a coordinated backup window and retain timestamped sets rather than mixing components from different runs
Older deletions cannot be recovered Every destination was a live mirror with no version history Enable dated snapshots or immutable retention appropriate to your storage system
The off-site archive exists but cannot be decrypted Recovery key or account access was stored with the same failed system Keep a protected, separately accessible copy of keys and document who can use them

Choosing storage by capacity, cost, and recovery time

A separate external hard drive or SSD is a practical second copy, but its capacity should be based on your current originals, expected annual growth, generated data you intend to retain, and at least one additional snapshot. SSDs offer quiet, fast restores and better shock resistance; hard drives generally provide more capacity per unit cost but should be protected from drops and vibration. No single model or size is appropriate without your library size and budget.

A NAS can automate local copies and provide versioning, but it is still at the same physical site unless another copy is sent elsewhere. Off-site storage reduces site-level risk but introduces recurring storage and retrieval costs, upload bandwidth limits, account-dependency, and the need to manage encryption. Compare options using these questions:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Does the copy include both originals and the database or index?
  • Is it on media separate from the server’s primary disks?
  • Is at least one copy outside the home or server room?
  • Can you retrieve an older version after deletion or corruption?
  • Are the database and media from a sufficiently coherent point in time?
  • Have you rehearsed a restore, and how long did it take?
  • Will capacity and ongoing cost still work as the library grows?

Maintenance after upgrades and storage moves

Review the plan whenever you upgrade the gallery, change a storage template, move originals, replace a database, or add a new import source. Re-run the path inventory and check that the backup job still reaches every mount. Confirm that retention has not silently changed and that off-site authentication and encryption keys remain usable.

Schedule a restore drill at a practical interval for the value of your library—at least after major migrations and whenever the backup architecture changes. Keep the latest verified procedure, software version, path map, and recovery-key location with the backup records. The goal is not merely to possess copies; it is to make the complete collection and its catalog recoverable when the original server is unavailable.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Data RecoveryHome ServerImmichphoto backupPhotoPrismself-hosting

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.