Skip to content

Rate this page
Thanks for your feedback
Thank you! The feedback has been submitted.

For help, click the link below to get free database assistance or contact our experts for personalized support.

Uninstall Percona Backup for MongoDB

Follow these steps to remove Percona Backup for MongoDB (PBM) from your environment.

Procedure

  1. Confirm no backups are running

    Check that no backup or restore is currently in progress:

    pbm list
    

    If an operation is still running, wait for it to finish (or cancel it) before continuing. Removing PBM while an operation is active can leave your backup storage or control collections in an inconsistent state.

  2. Disable point in time recovery

    If point in time recovery is still enabled, PBM will just start writing new oplog slices again right after cleanup

    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:

    pbm cleanup --older-than=0d --yes
    

    Warn

    If you’re using PBM’s multi-storage feature, you’ll need to repeat the cleanup with –profile 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.

    sudo apt remove percona-backup-mongodb
    
    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 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:

    use admin
    db.pbmAgents.drop()
    db.pbmBackups.drop()
    db.pbmCmd.drop()
    db.pbmConfig.drop()
    db.pbmLock.drop()
    db.pbmLockOp.drop()
    db.pbmLog.drop()
    db.pbmOpLog.drop()
    db.pbmPITR.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):

    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.


Last update: July 16, 2026
Created: July 16, 2026