-
Notifications
You must be signed in to change notification settings - Fork 23
Revise uninstallation guide for Percona Backup for MongoDB #391
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f362f05
Revise uninstallation guide for Percona Backup for MongoDB
igroene 03f7207
Revise uninstall instructions for Percona Backup
igroene 7ce9d5e
Revise uninstall instructions for PBM
igroene 5e0552f
add power number
igroene 1234a6e
Fix formatting for PBM database user section
igroene 3a73617
Update 'PITR' to 'point in time recovery' in uninstalling.md
igroene 0e27abd
Refactor PBM collection drop commands in uninstalling.md
igroene 74efab2
add missing collections
igroene ad818a3
Update docs/manage/uninstalling.md
igroene File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,84 @@ | ||
| # Uninstall Percona Backup for MongoDB | ||
|
|
||
| To uninstall Percona Backup for MongoDB, do the following steps: | ||
| Follow these steps to remove Percona Backup for MongoDB (PBM) from your environment. | ||
|
|
||
| ## Procedure {.power-number} | ||
|
|
||
| 1. Check that no backups are currently in progress in the output of [`pbm list`](../reference/pbm-commands.md#pbm-list). | ||
| 1. Confirm no backups are running | ||
|
|
||
| 2. Before the next 2 steps, make sure you know where the remote backup storage | ||
| is, so you can delete backups made by Percona Backup for MongoDB. If it is an S3-compatible object storage, you will need to use another tool such as Amazon AWS’s “aws s3”, Minio’s `mc`, the web AWS Management Console, etc. to do that once Percona Backup for MongoDB is uninstalled. Don’t forget to note the connection credentials before they are deleted too. | ||
| Check that no backup or restore is currently in progress: | ||
|
|
||
| 3. Uninstall the **pbm-agent** and `pbm` executables. If you installed using a | ||
| package manager, see [Install Percona Backup for MongoDB](../installation.md) for relevant package names and commands for your OS distribution. | ||
| ```bash | ||
| pbm list | ||
| ``` | ||
|
|
||
| 4. Drop the PBM control collections. | ||
| If an operation is still running, wait for it to finish (or [cancel it](../reference/pbm-commands.md#pbm-cancel-backup)) before continuing. Removing PBM while an operation is active can leave your backup storage or control collections in an inconsistent state. | ||
|
|
||
| 5. Drop the PBM database user. If this is a cluster, the `dropUser` command will | ||
| need to be run on each shard as well as in the config server replica set. | ||
| 2. Disable PITR | ||
|
|
||
| 6. (Optional) Delete the backups from the remote backup storage. | ||
| If point in time recovery is still enabled, PBM will just start writing new oplog slices again right after cleanup | ||
|
|
||
| ```bash | ||
| pbm config --set pitr.enabled=false | ||
| ``` | ||
|
|
||
| 3. (Optional) Delete backups from remote storage | ||
|
|
||
| If you no longer need the backups PBM created, delete them from the remote storage using the `pbm cleanup` command. For example: | ||
|
|
||
| ```bash | ||
| pbm cleanup --older-than=0d --yes | ||
| ``` | ||
|
|
||
| !!! warn | ||
|
igroene marked this conversation as resolved.
Outdated
|
||
|
|
||
| If you're using PBM's multi-storage feature, you'll need to repeat the cleanup with --profile <name> for each storage profile — pbm cleanup only targets the currently active one by default. | ||
|
|
||
| 4. Uninstall the pbm-agent and pbm executables | ||
|
|
||
| Run these commands on every node where PBM is installed. | ||
|
|
||
| === ":material-debian: On Debian and Ubuntu" | ||
|
|
||
| ```bash | ||
| sudo apt remove percona-backup-mongodb | ||
| ``` | ||
|
|
||
| === ":material-redhat: On RHEL and derivatives" | ||
|
|
||
| ```bash | ||
| sudo yum remove percona-backup-mongodb | ||
| ``` | ||
|
|
||
| If you installed PBM a different way (tarball, source build, Docker), remove the binaries and any systemd service/config files manually instead. See [Install Percona Backup for MongoDB](../installation.md) for details on how PBM was set up on your system. | ||
|
|
||
| 5. Drop the PBM control collections | ||
|
|
||
| PBM stores its state in a set of collections in the `admin` database — on the config server replica set for a sharded cluster, or on the replica set itself otherwise. Connect with `mongosh` and drop them: | ||
|
|
||
| ```javascript | ||
| use admin | ||
| db.pbmBackups.drop() | ||
| db.pbmAgents.drop() | ||
| db.pbmConfig.drop() | ||
| db.pbmCmd.drop() | ||
| db.pbmLock.drop() | ||
| db.pbmLockOp.drop() | ||
| db.pbmLog.drop() | ||
| db.pbmOpLog.drop() | ||
| db.pbmPITRChunks.drop() | ||
| db.pbmPITRState.drop() | ||
| db.pbmRestores.drop() | ||
| db.pbmStatus.drop() | ||
| ``` | ||
|
|
||
| 6. Drop the PBM database user | ||
|
|
||
| Drop the MongoDB user PBM used to authenticate (commonly named `pbm` or similar — check what you used when [setting up authentication](../install/configure-authentication.md)): | ||
|
|
||
| ```javascript | ||
| use admin | ||
| db.dropUser("pbm") | ||
| ``` | ||
|
|
||
| **In a sharded cluster**, run this same command on **each shard's primary** as well as on the **config server replica set** — dropping the user in one place doesn't remove it from the others. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.