From a99c48c1154670f802f7b8c6bd367014df7de7d8 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 26 Dec 2024 15:16:29 -0800 Subject: [PATCH] Documentation / CLI help clarifications around "--original-port" (#418). --- borgmatic/commands/arguments.py | 2 +- docs/how-to/backup-your-databases.md | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/borgmatic/commands/arguments.py b/borgmatic/commands/arguments.py index 7bd1d74e..1252270b 100644 --- a/borgmatic/commands/arguments.py +++ b/borgmatic/commands/arguments.py @@ -1189,7 +1189,7 @@ def make_parsers(): restore_group.add_argument( '--original-port', type=int, - help='The port where the dump to restore came from, only necessary if you need to disambiguate dumps', + help="The port where the dump to restore came from (if that port is in borgmatic's configuration), only necessary if you need to disambiguate dumps", ) restore_group.add_argument( '--hook', diff --git a/docs/how-to/backup-your-databases.md b/docs/how-to/backup-your-databases.md index c1e0576b..71ce70ff 100644 --- a/docs/how-to/backup-your-databases.md +++ b/docs/how-to/backup-your-databases.md @@ -432,7 +432,7 @@ borgmatic restore --archive latest --database users --original-hostname host1.ex ``` This selects a `users` database to restore, but only if it originally came -from the host `host1.example.org`. And this command won't restore `users` +from the host `host1.example.org`. This command won't restore `users` databases from any other hosts. Here's another example configuration: @@ -453,7 +453,8 @@ And a command to restore just one of the databases: borgmatic restore --archive latest --database users --original-port 5433 ``` -That restores a `users` database only if it originally came from port `5433`. +That restores a `users` database only if it originally came from port `5433` +*and* if that port is in borgmatic's configuration, e.g. `port: 5433`. Finally, check out this configuration: @@ -473,8 +474,8 @@ borgmatic restore --archive latest --database users --hook postgresql ``` That restores a `users` database only if it was dumped using the -`postgresql_databases:` data source hook. And this command won't restore -`users` databases that were dumped using other hooks. +`postgresql_databases:` data source hook. This command won't restore `users` +databases that were dumped using other hooks. Note that these flags don't change the hostname or port to which the database is actually restored. For that, see below about restoring to an alternate