You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PG-Bkup supports backing up all databases on the server using the `--all-databases` (`-a`) flag. By default, this creates separate backup files for each database. If you prefer a single backup file, you can use the `--all-in-one` (`-A`) flag.
11
+
12
+
Backing up all databases is useful for creating a snapshot of the entire database server, whether for disaster recovery or migration purposes.
13
+
## Backup Modes
14
+
15
+
### Separate Backup Files (Default)
16
+
17
+
Using --all-databases without --all-in-one creates individual backup files for each database.
18
+
19
+
- Creates separate backup files for each database.
20
+
- Provides more flexibility in restoring individual databases or tables.
21
+
- Can be more manageable in cases where different databases have different retention policies.
22
+
- Might take slightly longer due to multiple file operations.
23
+
- It is the default behavior when using the `--all-databases` flag.
24
+
- It does not backup system databases (`postgres`,`template0`, `template1`,...).
25
+
26
+
**Command:**
27
+
28
+
```bash
29
+
docker run --rm --network your_network_name \
30
+
-v $PWD/backup:/backup/ \
31
+
-e "DB_HOST=dbhost" \
32
+
-e "DB_PORT=5432" \
33
+
-e "DB_USERNAME=username" \
34
+
-e "DB_PASSWORD=password" \
35
+
jkaninda/pg-bkup backup --all-databases
36
+
```
37
+
### Single Backup File
38
+
39
+
Using --all-in-one (-A) creates a single backup file containing all databases.
40
+
41
+
- Creates a single backup file containing all databases.
42
+
- Easier to manage if you need to restore everything at once.
43
+
- Faster to back up and restore in bulk.
44
+
- Can be problematic if you only need to restore a specific database or table.
45
+
- It is recommended to use this option for disaster recovery purposes.
46
+
- It backups system databases as well.
47
+
48
+
```bash
49
+
docker run --rm --network your_network_name \
50
+
-v $PWD/backup:/backup/ \
51
+
-e "DB_HOST=dbhost" \
52
+
-e "DB_PORT=5432" \
53
+
-e "DB_USERNAME=username" \
54
+
-e "DB_PASSWORD=password" \
55
+
jkaninda/pg-bkup backup --all-in-one
56
+
```
57
+
58
+
### When to Use Which?
59
+
60
+
- Use `--all-in-one` if you want a quick, simple backup for disaster recovery where you'll restore everything at once.
61
+
- Use `--all-databases` if you need granularity in restoring specific databases or tables without affecting others.
0 commit comments