At a minimum, a backup of PhotoPrism Pro should include the files in your originals folder and a copy of the index database. We also recommend backing up the storage folder so that you don't need to recreate any thumbnail or sidecar files, and your backup includes all config files, certificates, and customizations.

MariaDB

The easiest way to create a full backup is to first run the backup command to generate a MariaDB database dump as shown below. Then back up your originals and storage folders using any standard file backup utility.

SQLite

If you use SQLite, a full backup of both folders is mandatory, but it is not necessary to create a dump first, as there already is a copy of the index database in the storage folder.

Important Folders

Originals

The originals folder contains your original photo and video files. By default, it is located at /opt/photoprism/originals on the host server and at /photoprism/originals in the app container.

You can back it up and restore it using any standard file backup utility if you haven't already set this up.

Storage

SQLite, config, cache, thumbnail, and sidecar files are saved in the storage folder, which by default is located at /opt/photoprism/storage on the host server and at /photoprism/storage in the app container.

We recommend that you back up this folder as well so that you don't need to recreate the thumbnails and have a complete backup of your configuration. As for the originals folder, you can use any standard file backup utility to do this.

Backup Command

The easiest way to create an index SQL backup dump is to run this command in a terminal:

docker compose exec photoprism photoprism backup -i -f

If you are using Podman on a Red Hat-compatible Linux distribution:

podman-compose exec photoprism photoprism backup -i -f

By default, a backup is created in storage/backup/mysql/[YYYY-MM-DD].sql. A custom backup folder can be configured with PHOTOPRISM_BACKUP_PATH.

Omit the -f flag if you do not want to overwrite existing files. You can also specify a custom filename as an argument (or - to write the SQL dump to stdout):

docker compose exec photoprism photoprism backup -i [filename]

The easiest way to create a full backup is to run the backup command before backing up your storage folder. How to create SQL dumps from SQLite is shown in our advanced backup guide.

Note that our guides use the new docker compose command by default. If your server does not yet support it, the old docker-compose command will still work. Users of Red Hat Enterprise Linux® and compatible Linux distributions such as CentOS, Fedora, AlmaLinux, and Rocky Linux can substitute the docker and docker compose commands with podman and podman-compose as drop-in replacements.

Restore Command

To restore the index from an existing database dump, you can run the following command:

docker compose exec photoprism photoprism restore -i -f

If you are using Podman on a Red Hat-compatible Linux distribution:

podman-compose exec photoprism photoprism restore -i -f

This will automatically search the backup folder for the most recent index dump and restore it. A custom backup folder can be configured with PHOTOPRISM_BACKUP_PATH.

Omit the -f flag to prevent overwriting an existing index. As with the backup command, you can also specify a specific dump filename as an argument:

docker compose exec photoprism photoprism restore -i [filename]

When the database is restored, all user accounts and passwords are restored as well. If users have changed their password, they will have to log in with their old password.

If you have a backup copy of your storage and originals folders, the easiest way is to restore those folders first and then run the restore command in case you are using MariaDB. Otherwise, you additionally need to perform a complete rescan of your library to recreate missing sidecar and thumbnail files. Some of the metadata and your albums can also be recovered from YAML sidecar files even if you don't have a copy of the index database, unless you have disabled this feature.

PhotoPrism® Documentation

For detailed information on specific product features, services, and related resources, see our Knowledge Base, or read the User Guide for help using the web user interface: