Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBM-1213: Backup/Restore with included Users&Roles #930

Closed
wants to merge 25 commits into from

Conversation

boris-ilijic
Copy link
Member

@boris-ilijic boris-ilijic commented Mar 25, 2024

PR for https://perconadev.atlassian.net/browse/PBM-1213

The feature expands backup & restore commands with the possibility to include database specific users and roles. Following use cases are added:

  • selective backup with included users&roles
  • selective restore with included users&roles from selective backup
  • selective restore with included users&roles from full backup

In existing pbm backup and pbm restore commands the new options --with-users-and-roles are added.

Selective backup & restore with users&roles example:

$ pbm backup --ns="mydb.*" --with-users-and-roles

$ pbm describe-backup --with-collections 2024-03-25T15:33:48Z  
name: "2024-03-25T15:33:48Z"
namespaces:
- mydb.*
replsets:
- name: rs0
  collections:
  - mydb.$admin.system.roles
  - mydb.$admin.system.users
  - mydb.$admin.system.version
  - mydb.c1
  - mydb.c2

$ pbm restore --ns="mydb.*" --with-users-and-roles 2024-03-25T15:33:48Z

Selective restore from full backup example:

$ pbm backup
Starting backup '2024-03-27T16:48:21Z'.......

$ pbm restore --ns="mydb1.*, mydb2.*" --with-users-and-roles 

@boris-ilijic boris-ilijic marked this pull request as ready for review March 26, 2024 11:50
@boris-ilijic boris-ilijic requested a review from defbin as a code owner March 26, 2024 11:50
@boris-ilijic boris-ilijic marked this pull request as draft March 26, 2024 16:53
@boris-ilijic boris-ilijic marked this pull request as ready for review March 27, 2024 16:57
@boris-ilijic boris-ilijic changed the title PBM-1213: Selective Backup/Restore with included Users/Roles PBM-1213: Backup/Restore with included Users/Roles Mar 27, 2024
@boris-ilijic boris-ilijic changed the title PBM-1213: Backup/Restore with included Users/Roles PBM-1213: Backup/Restore with included Users&Roles Mar 27, 2024
defbin
defbin previously approved these changes Apr 3, 2024
Copy link
Member

@defbin defbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok

@boris-ilijic
Copy link
Member Author

Selective backup of the Config server is the issue bacause MongoDump supports just single namespace and we need to backup config database as well as user&roles from admin database. Therefore closing for now.

@defbin defbin added this to the 2.4.1 milestone Aug 9, 2024
@boris-ilijic boris-ilijic deleted the PBM-1213-selective-restore-with-users-roles branch December 18, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants