Skip to content

Commit 1a72602

Browse files
Mraedismmomjian
andauthored
docs: Add DB name to backup-and-restore (immich-app#13244)
* Update backup-and-restore.md changelog: Add database name to the restore command and document it in the notes * docs: remove added database flag and change warn wording * docs: fix forgotten warning change Co-authored-by: Matthew Momjian <[email protected]> --------- Co-authored-by: Matthew Momjian <[email protected]>
1 parent f7ad6ef commit 1a72602

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

docs/docs/administration/backup-and-restore.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=postgre
3434
docker compose down -v # CAUTION! Deletes all Immich data to start from scratch
3535
## Uncomment the next line and replace DB_DATA_LOCATION with your Postgres path to permanently reset the Postgres database
3636
# rm -rf DB_DATA_LOCATION # CAUTION! Deletes all Immich data to start from scratch
37-
docker compose pull # Update to latest version of Immich (if desired)
38-
docker compose create # Create Docker containers for Immich apps without running them
37+
docker compose pull # Update to latest version of Immich (if desired)
38+
docker compose create # Create Docker containers for Immich apps without running them
3939
docker start immich_postgres # Start Postgres server
40-
sleep 10 # Wait for Postgres server to start up
40+
sleep 10 # Wait for Postgres server to start up
41+
# Check the database user if you deviated from the default
4142
gunzip < "/path/to/backup/dump.sql.gz" \
4243
| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
43-
| docker exec -i immich_postgres psql --username=postgres # Restore Backup
44-
docker compose up -d # Start remainder of Immich apps
44+
| docker exec -i immich_postgres psql --username=postgres # Restore Backup
45+
docker compose up -d # Start remainder of Immich apps
4546
```
4647

4748
</TabItem>
@@ -55,12 +56,13 @@ docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=postgre
5556
docker compose down -v # CAUTION! Deletes all Immich data to start from scratch
5657
## Uncomment the next line and replace DB_DATA_LOCATION with your Postgres path to permanently reset the Postgres database
5758
# Remove-Item -Recurse -Force DB_DATA_LOCATION # CAUTION! Deletes all Immich data to start from scratch
58-
docker compose pull # Update to latest version of Immich (if desired)
59-
docker compose create # Create Docker containers for Immich apps without running them
59+
docker compose pull # Update to latest version of Immich (if desired)
60+
docker compose create # Create Docker containers for Immich apps without running them
6061
docker start immich_postgres # Start Postgres server
61-
sleep 10 # Wait for Postgres server to start up
62-
gc "C:\path\to\backup\dump.sql" | docker exec -i immich_postgres psql --username=postgres # Restore Backup
63-
docker compose up -d # Start remainder of Immich apps
62+
sleep 10 # Wait for Postgres server to start up
63+
# Check the database user if you deviated from the default
64+
gc "C:\path\to\backup\dump.sql" | docker exec -i immich_postgres psql --username=postgres # Restore Backup
65+
docker compose up -d # Start remainder of Immich apps
6466
```
6567

6668
</TabItem>
@@ -103,6 +105,7 @@ services:
103105
Then you can restore with the same command but pointed at the latest dump.
104106
105107
```bash title='Automated Restore'
108+
# Be sure to check the username if you changed it from default
106109
gunzip < db_dumps/last/immich-latest.sql.gz \
107110
| sed "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);/g" \
108111
| docker exec -i immich_postgres psql --username=postgres

0 commit comments

Comments
 (0)