Skip to content

Commit 22c1fbf

Browse files
Update backup-selective.md
1 parent 8b8dd40 commit 22c1fbf

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

docs/usage/backup-selective.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Multi-format is the default data format for both full and selective backups sinc
2828

2929
## Selective backup with users and roles
3030

31-
Percona Backup for MongoDB allows you to perform selective backups and restores of databases and collections. Additionally, you can choose to include users and roles defined in the database in your selective backup, ensuring that access control is restored along with the data.
31+
Percona Backup for MongoDB allows you to perform selective backups and restores of databases and collections. Additionally, you can choose to include **users and roles defined** in the database in your selective backup, ensuring that access control is restored along with the data.
3232

3333
This feature is useful in the following cases:
3434

@@ -46,7 +46,24 @@ where:
4646

4747
`--ns="mydb.*"` specifies the namespace (all collections in mydb).
4848

49-
`--with-users-and-roles` ensures that users and roles defined in mydb are included in the backup.
49+
`--with-users-and-roles` ensures that users and roles defined in `mydb` are included in the backup.
50+
51+
The `--with-users-and-roles` flag ensures that any custom users and roles defined within the target database are included, maintaining the integrity of your access control list (ACL) without needing a full cluster restore.
52+
53+
54+
??? info "What heppens under the hood?
55+
- Percona Backup for MongoDB captures all collections within `mydb`.
56+
- Percona Backup for MongoDB filters the users and roles for entities where the `db` field matches `mydb`.
57+
- Global roles or users defined in the admin database for other namespaces are excluded.
58+
59+
**Example**
60+
61+
```sh
62+
pbm backup --ns="invoices.*" --with-users-and-roles
63+
```
64+
65+
This command backs up all collections in the **invoices** database along with its users and roles.
66+
5067

5168

5269
## Next steps

0 commit comments

Comments
 (0)