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
Copy file name to clipboardExpand all lines: docs/usage.md
+54-9Lines changed: 54 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ $ belt [OPTIONS] COMMAND [ARGS]...
21
21
*`dst-dsn`: Print a dsn to stdout that you can use to...
22
22
*`check-pkeys`: Print out lists of tables with and without...
23
23
*`check-connectivity`: Returns exit code 0 if pgbelt can connect...
24
-
*`revoke-logins`: Discovers all users in the db who can log...
25
-
*`restore-logins`: Grant permission to log in for any user...
24
+
*`revoke-logins`: Discovers all users who can log in and...
25
+
*`restore-logins`: Discovers all roles that currently have...
26
26
*`precheck`: Report whether your source database meets...
27
27
*`reset`: Reset an in-progress migration before...
28
28
*`dump-schema`: Dumps and sanitizes the schema from the...
@@ -40,6 +40,7 @@ $ belt [OPTIONS] COMMAND [ARGS]...
40
40
*`analyze`: Run ANALYZE in the destination database.
41
41
*`validate-data`: Compares data in the source and target...
42
42
*`sync`: Sync and validate all data that is not...
43
+
*`diff-sequences`: Compare source and destination sequence...
43
44
*`teardown-back-replication`: Stops pglogical replication from the...
44
45
*`teardown-forward-replication`: Stops pglogical replication from the...
45
46
*`teardown`: Removes all pglogical configuration from...
@@ -188,10 +189,8 @@ $ belt check-connectivity [OPTIONS] DC [DB]
188
189
189
190
## `belt revoke-logins`
190
191
191
-
Discovers all users in the db who can log in, saves them in the config file,
192
-
then revokes their permission to log in. Use this command to ensure that all
193
-
writes to the source database have been stopped before syncing sequence values
194
-
and tables without primary keys.
192
+
Discovers all users who can log in and revokes their permission.
193
+
Stateless — queries pg_roles each time rather than caching a user list.
195
194
196
195
Always excludes built-in service accounts (pglogical, rdsadmin, monitoring, etc.).
197
196
Use --exclude-user to exclude additional specific usernames.
@@ -225,10 +224,11 @@ $ belt revoke-logins [OPTIONS] DC [DB]
225
224
226
225
## `belt restore-logins`
227
226
228
-
Grant permission to log in for any user present in the config file. The user
229
-
must already have a password. This will not generate or modify existing
230
-
passwords for users.
227
+
Discovers all roles that currently have NOLOGIN and re-enables login for
228
+
them, excluding built-in service accounts and any roles specified via
229
+
--exclude-user / --exclude-pattern.
231
230
231
+
This is stateless — it does not rely on a previously saved user list.
232
232
Intended to be used after revoke-logins in case a rollback is required.
233
233
234
234
@@ -250,6 +250,8 @@ $ belt restore-logins [OPTIONS] DC [DB]
250
250
**Options**:
251
251
252
252
*`--json`: Output structured JSON instead of human-readable tables.
253
+
*`-e, --exclude-user TEXT`: Additional usernames to exclude from restoration (can be repeated).
254
+
*`-p, --exclude-pattern TEXT`: SQL LIKE patterns to exclude usernames (e.g. '%%myapp%%'). Can be repeated.
253
255
*`--help`: Show this message and exit.
254
256
255
257
## `belt precheck`
@@ -299,6 +301,12 @@ This command:
299
301
Note: sequence values are intentionally left unchanged. They only need to be
300
302
synchronized after cutover by running sync-sequences.
301
303
304
+
WARNING: --force skips the safety check that prevents resetting when the
305
+
destination is the same size or larger than the source. This is intended for
306
+
post-migration resets where SRC and DST are identical. Using --force on a
307
+
live migration where DST is genuinely the primary copy will result in
308
+
irreversible data loss.
309
+
302
310
303
311
Requires both src and dst to be not null in the config file.
304
312
@@ -318,6 +326,7 @@ $ belt reset [OPTIONS] DC [DB]
318
326
**Options**:
319
327
320
328
*`--json`: Output structured JSON instead of human-readable tables.
329
+
*`--force`: Skip the dataset-size failsafe that normally prevents reset when DST >= SRC. Use ONLY after a completed migration when you are certain the destination database should be wiped and all its up-to-date data discarded.
321
330
*`--help`: Show this message and exit.
322
331
323
332
## `belt dump-schema`
@@ -778,6 +787,42 @@ $ belt sync [OPTIONS] DC [DB]
0 commit comments