Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update(docs): Update documentation #6430

Merged
merged 33 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b1472bb
Documentation corrections
aviv926 Jan 16, 2024
c8eb7df
fix import
aviv926 Jan 16, 2024
926e5d6
add firewall note
aviv926 Jan 16, 2024
115ac6c
npm run format:fix
aviv926 Jan 16, 2024
7a3cfa5
fixs
aviv926 Jan 17, 2024
429d407
npm run format:fix
aviv926 Jan 17, 2024
ca24071
space
aviv926 Jan 17, 2024
a8084d1
fix note
aviv926 Jan 17, 2024
9f83c6d
admin-jobs.png image update + fixes
aviv926 Jan 19, 2024
9f4e24f
Storage Template.md update
aviv926 Jan 19, 2024
7534f26
Add new Troubleshooting about symbolic link in library
aviv926 Jan 21, 2024
83dd696
Updating the libraries.md
aviv926 Jan 21, 2024
b4d6a90
Updating the libraries.md
aviv926 Jan 21, 2024
0c1ecee
Corrections
aviv926 Jan 21, 2024
9fd80db
add `/`
aviv926 Jan 21, 2024
a51ef49
...
aviv926 Jan 21, 2024
a94e907
Add Python script to remove-offline-files.md
aviv926 Jan 22, 2024
ba74a6d
npm run format:fix
aviv926 Jan 22, 2024
b7da0dd
Add info about HDR in FAQ
aviv926 Jan 24, 2024
b04d89c
Merge branch 'main' of https://github.com/aviv926/immich into Documen…
aviv926 Jan 24, 2024
6cc8eb2
My wrong merge
aviv926 Jan 24, 2024
6e8e792
add info about symlink
aviv926 Jan 24, 2024
0523046
[Community] + PowerShell
aviv926 Jan 24, 2024
efe2697
add 360 photo support to Features in README
aviv926 Jan 24, 2024
b13cc26
add info about remote ML and info about orphaned files from the exter…
aviv926 Jan 24, 2024
517b61c
Typo
aviv926 Jan 24, 2024
9e4a22b
add note about storage locations
aviv926 Jan 24, 2024
7a46617
add info about Purge for portainer and link to info about asset types…
aviv926 Jan 24, 2024
4feb308
npm run format:fix
aviv926 Jan 24, 2024
09dc5cf
Add FAQ about "faces" that aren't faces
aviv926 Jan 25, 2024
d348340
Update docs/docs/administration/backup-and-restore.md
jrasm91 Jan 25, 2024
42b9107
Update docs/docs/administration/backup-and-restore.md
jrasm91 Jan 25, 2024
c2a67f5
Merge remote-tracking branch 'origin/main' into pr/aviv926/6430
jrasm91 Jan 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 71 additions & 5 deletions docs/docs/administration/backup-and-restore.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Backup and Restore

A [3-2-1 backup strategy](https://www.backblaze.com/blog/the-3-2-1-backup-strategy/) is recommended to protect your data. You should keep copies of your uploaded photos/videos as well as the Immich database for a comprehensive backup solution. This page provides an overview on how to backup the database and the location of user-uploaded pictures and videos. A template bash script that can be run as a cron job is provided [here](/docs/guides/template-backup-script.md)
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## Database

Expand All @@ -14,7 +15,10 @@ Refer to the official [postgres documentation](https://www.postgresql.org/docs/c

The recommended way to backup and restore the Immich database is to use the `pg_dumpall` command.

```bash title='Backup'
<Tabs>
<TabItem value="Linux system based Backup" label="Linux system based Backup" default>

```bash title='Bash'
docker exec -t immich_postgres pg_dumpall -c -U postgres | gzip > "/path/to/backup/dump.sql.gz"
```

Expand All @@ -28,6 +32,26 @@ gunzip < "/path/to/backup/dump.sql.gz" | docker exec -i immich_postgres psql -U
docker compose up -d # Start remainder of Immich apps
```

</TabItem>
<TabItem value="Windows system based Backup" label="Windows system based Backup">

```bash title='PowerShell'
jrasm91 marked this conversation as resolved.
Show resolved Hide resolved
docker exec -t immich_postgres pg_dumpall -c -U postgres > "\path\to\backup\dump.sql"
```

```bash title='Restore'
jrasm91 marked this conversation as resolved.
Show resolved Hide resolved
docker compose down -v # CAUTION! Deletes all Immich data to start from scratch.
docker compose pull # Update to latest version of Immich (if desired)
docker compose create # Create Docker containers for Immich apps without running them.
docker start immich_postgres # Start Postgres server
sleep 10 # Wait for Postgres server to start up
gc "C:\path\to\backup\dump.sql" | docker exec -i immich_postgres psql -U postgres -d immich # Restore Backup
docker compose up -d # Start remainder of Immich apps
```

</TabItem>
</Tabs>

Note that for the database restore to proceed properly, it requires a completely fresh install (i.e. the Immich server has never run since creating the Docker containers). If the Immich app has run, Postgres conflicts may be encountered upon database restoration (relation already exists, violated foreign key constraints, multiple primary keys, etc.).

The database dumps can also be automated (using [this image](https://github.com/prodrigestivill/docker-postgres-backup-local)) by editing the docker compose file to match the following:
Expand Down Expand Up @@ -64,15 +88,54 @@ gunzip < db_dumps/last/immich-latest.sql.gz | docker exec -i immich_postgres psq
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`
2. `UPLOAD_LOCATION/upload`
3. `UPLOAD_LOCATION/profile`

### Asset Types and Storage Locations

<Tabs>
<TabItem value="storage template engine OFF (Default)." label="storage template engine OFF (Default)." default>
aviv926 marked this conversation as resolved.
Show resolved Hide resolved

:::note
`\library\library` folder is not used by default on new machines running version 1.92.0. These are if the system administrator activated the storage template engine, for [more info](https://github.com/immich-app/immich/releases#:~:text=the%20partner%E2%80%99s%20assets.-,Hardening%20storage%20template,-We%20have%20further).
aviv926 marked this conversation as resolved.
Show resolved Hide resolved
:::

**1. User-Specific Folders:**

- Each user has a unique string representing them.
- You can find your user ID in Account Account Settings -> Account -> User ID.

**2. Asset Types and Storage Locations:**

- **Source Assets:**
- Original assets uploaded through the browser interface&mobile&CLI.
aviv926 marked this conversation as resolved.
Show resolved Hide resolved
- Stored in `\library\upload\<userID>`.
- **Avatar Images:**
- User profile images.
- Stored in `\library\profile\<userID>`.
- **Thumbs Images:**
- Preview images (blurred, small, large) for each asset and thumbnails for recognized faces.
- Stored in `\library\thumbs\<userID>`.
- **Encoded Assets:**
- By default, unless otherwise specified re-encoded video assets for wider compatibility.
- Stored in `\library\encoded-video\<userID>`.

</TabItem>
<TabItem value="storage template engine ON" label="storage template engine ON">

:::note
If you choose to activate the storage template engine, it will move all assets to `\library\library\<userID>`.

When you turn off the storage template engine, it will leave the assets in `\library\library\<userID>` and will not return them to `\library\upload`.
**New assets** will be saved to `\library\upload`.
:::

**1. User-Specific Folders:**

- Each user has a unique string representing them.
- The main user is "Admin" (but only for `\library\library\`)
- Other users have different string identifiers.
- You can find your user ID in Account Account Settings > Account > User ID.
- You can find your user ID in Account Account Settings -> Account -> User ID.

**2. Asset Types and Storage Locations:**

Expand All @@ -93,6 +156,9 @@ Immich stores two types of content in the filesystem: (1) original, unmodified c
- Temporarily located in `\library\upload\<userID>`.
- Transferred to `\library\library\<userID>` upon successful upload.

</TabItem>
</Tabs>

:::danger
Do not touch the files inside these folders under any circumstances except taking a backup, changing or removing an asset can cause untracked and missing files.
You can think of it as App-Which-Must-Not-Be-Named, the only access to viewing, changing and deleting assets is only through the mobile or browser interface.
Expand Down
11 changes: 9 additions & 2 deletions docs/docs/guides/database-gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ A short guide on connecting [pgAdmin](https://www.pgadmin.org/) to Immich.

:::note

- In order to connect to the database the immich_postgres container **must be running**.
- The passwords and usernames used below match the ones specified in the example `.env` file. If changed, please use actual values instead.
In order to connect to the database the immich_postgres container **must be running**.

The passwords and usernames used below match the ones specified in the example `.env` file. If changed, please use actual values instead.

**Optional:** To connect to the database **outside** of your Docker's network:
aviv926 marked this conversation as resolved.
Show resolved Hide resolved

- Expose port 5432 in your `docker-compose.yml` file.
- Edit the PostgreSQL [`pg_hba.conf`](https://www.postgresql.org/docs/current/auth-pg-hba-conf.html) file.
jrasm91 marked this conversation as resolved.
Show resolved Hide resolved
- Make sure your firewall does not block access to port 5432.

:::

Expand Down
Loading