diff --git a/docs/docs/FAQ.md b/docs/docs/FAQ.md index 9a6da65197f9a..4171a574f9ef6 100644 --- a/docs/docs/FAQ.md +++ b/docs/docs/FAQ.md @@ -69,6 +69,10 @@ The non-root user/group needs read/write access to the volume mounts, including The admin password can be reset by running the [reset-admin-password](/docs/administration/server-commands.md) command on the immich-server. +### How can I backup data from Immich? + +See [backup and restore](/docs/administration/backup-and-restore.md). + ### How can I **purge** data from Immich? Data for Immich comes in two forms: diff --git a/docs/docs/administration/backup-and-restore.md b/docs/docs/administration/backup-and-restore.md new file mode 100644 index 0000000000000..3a35676070cc0 --- /dev/null +++ b/docs/docs/administration/backup-and-restore.md @@ -0,0 +1,25 @@ +# Backup and Restore + +## Database + +:::info +Refer to the official [postgres documentation](https://www.postgresql.org/docs/current/backup.html) for details about backing up and restoring a postgres database. +::: + +The recommended way to backup and restore the Immich database is to use the `pg_dumpall` command. + +```bash title='Backup' +docker exec -t immich_postgres pg_dumpall -c -U postgres | gzip > "/path/to/backup/dump.sql.gz" +``` + +```bash title='Restore' +gunzip < /path/to/backup/dump.sql.gz | docker exec -i immich_postgres psql -U postgres -d immich +``` + +## Filesystem + +Immich stores two types of content in the filesystem: (1) original, unmodified content, and (2) generated content. Only the original content needs to be backed-up, which includes the following folders: + +1. `UPLOAD_LOCATION/library` +1. `UPLOAD_LOCATION/upload` +1. `UPLOAD_LOCATION/profile`