PBM-1294 selective logical backup/restore with Users & Roles#337
PBM-1294 selective logical backup/restore with Users & Roles#337rasika-chivate wants to merge 41 commits intomainfrom
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jcechace
left a comment
There was a problem hiding this comment.
LGTM. Few things
- consider explicitly mentionn that
--with-users-and-rolesrequires a collection wildcard (so--ns='test.*'is ok, but--ns='test.col'is not - describe when
--with-users-and-rolesis required forpbm restore(in general only if--nsis used) see percona/percona-backup-mongodb#1260
But these are just options
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| #### Overview | ||
|
|
||
| Percona Backup for MongoDB allows you to perform selective restore 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. |
There was a problem hiding this comment.
This is in the restore section, but it says 'include ... in your selective backup'. Suggest rewording to 'include ... in your selective restore' (or 'restore users and roles alongside the data') to avoid confusion.
| Percona Backup for MongoDB allows you to perform selective restore 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. | |
| Percona Backup for MongoDB allows you to perform selective restore of databases and collections. Additionally, you can choose to include **users and roles defined** in the database in your selective restore, ensuring that access control is restored along with the data. |
|
|
||
| Percona Backup for MongoDB enables you to perform selective backups of databases and collections. Also, 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. | ||
|
|
||
| To back up a specific namespace and include users and roles, run the following command: |
There was a problem hiding this comment.
The restore page documents important constraints for --with-users-and-roles (e.g., requiring a collection wildcard like mydb.*, excluding cluster/global users/roles, and overwrite behavior on restore). This backup page currently doesn’t call out the wildcard requirement or explicitly clarify the same scope limitation (db-scoped only). Suggest adding a short warning/note here for consistency so users don’t try --ns=\"db.collection\" or assume cluster-wide users/roles are included.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
|
||
| Multi-format is the default data format for both full and selective backups since it allows selective restore. Note, however, that you can make only full restores from backups made with earlier versions of Percona Backup for MongoDB. | ||
|
|
||
| ## Selective backup with users and roles |
There was a problem hiding this comment.
I think an extra short section should be also under general description + version when feature (selective backup AND restore with users/roles) is added https://docs.percona.com/percona-backup-mongodb/features/selective-backup.html or at least this section should be rewritten https://docs.percona.com/percona-backup-mongodb/features/selective-backup.html#restore-a-database-with-users-and-roles
| ```sh | ||
| pbm backup --ns="invoices.*" --with-users-and-roles |
There was a problem hiding this comment.
What is the point to provide same command twice? Here and above?
pbm backup --ns="mydb.*" --with-users-and-roles
| ``` | ||
|
|
||
| This command backs up all collections in the **invoices** database, along with its users and roles. | ||
|
|
There was a problem hiding this comment.
This restriction isn't mentioned
pbm backup --ns=test.test --with-users-and-roles
Error: parse --with-users-and-roles option: Including users and roles are not allowed for specific collection. Use --ns='db.*' to specify the whole database instead
| pbm restore <backup_name> --ns <database.*> --with-users-and-roles | ||
| ``` | ||
|
|
||
| ### Selective restore with users and roles |
There was a problem hiding this comment.
Both restores either from full backup or from selective backup are considered as selective restore if --ns option is used. This section should be merged with prev one as it duplicate. We need just add an extra note that now it's possible to do selective restore with users and roles not only from full backup but also from selective backup (if it actually contains u&r).
Also there is no note that now u&r are also restored if selected PITR restore is selected https://perconadev.atlassian.net/browse/PBM-1521
Provide a detailed documentation of the command used for selective backup and restore. Include instructions on how to optionally include related users and roles in the backup and restoration process. Ensure that all syntax, parameters, and examples are clearly explained.
Refer to the ticket PBM-1294 for more information.