Skip to content
logo
Percona Backup for MongoDB
How PBM works
Initializing search
    percona/pbm-docs
    percona/pbm-docs
    • Home
        • Overview
        • Logical backups and restores
        • Physical backups and restores
        • Selective backup and restore
        • Incremental physical backups
        • Point-in-time recovery
      • Comparison with MongoDB
      • How PBM works
        • Usage example
        • Next steps
        • Useful links
        • PBM architecture
        • pbm-agent
        • PBM CLI
        • PBM control collections
          • Overview
          • Remote backup storage configuration examples
      • Authentication
      • Supported MongoDB deployments
      • Supported MongoDB versions
        • Overview
        • Method 1. From repositories
        • Method 2. Build from source
        • Method 3. Download tarballs
        • Method 4. Deploy on Kubernetes
      • Set up and configure
      • Make a backup
      • Make a restore
      • Make a point-in-time restore
      • List backups
      • View detailed information about a backup
      • Schedule backups
      • Cancel a backup
      • Delete backups
      • View restore progress
      • Replay oplog from arbitrary start time
      • View backup logs
      • PBM configuration via pipelines
      • Automate access to S3 buckets for PBM
      • Diagnose PBM
      • Check status
      • Upgrade PBM
      • Remove PBM
    • FAQ
      • PBM commands
        • Configuration file
        • Remote backup storage options
        • Point-in-time recovery options
        • Backup options
        • Restore options
      • Glossary
      • Release notes index
      • Percona Backup for MongoDB 2.0.5 (2023-03-23)
      • Percona Backup for MongoDB 2.0.4 (2023-02-21)
      • Percona Backup for MongoDB 2.0.3 (2023-01-11)
      • Percona Backup for MongoDB 2.0.2 (2022-10-27)
      • Percona Backup for MongoDB 2.0.1 (2022-10-12)
      • Percona Backup for MongoDB 2.0.0 (2022-09-21)
      • Percona Backup for MongoDB 1.8.1 (2022-07-12)
      • Percona Backup for MongoDB 1.8.0 (2022-06-09)
      • Percona Backup for MongoDB 1.7.0 (2022-04-18)
      • Percona Backup for MongoDB 1.6.1 (2021-11-04)
      • Percona Backup for MongoDB 1.6.0 (2021-08-16)
      • Percona Backup for MongoDB 1.5.0 (2021-05-10)
      • Percona Backup for MongoDB 1.4.1 (2021-01-28)
      • Percona Backup for MongoDB 1.4.0 (2020-12-24)
      • Percona Backup for MongoDB 1.3.4 (2020-11-19)
      • Percona Backup for MongoDB 1.3.3 (2020-11-04)
      • Percona Backup for MongoDB 1.3.2 (2020-10-14)
      • Percona Backup for MongoDB 1.3.1 (2020-09-03)
      • Percona Backup for MongoDB 1.3.0 (2020-08-26)
      • Percona Backup for MongoDB 1.2.1 (2020-07-27)
      • Percona Backup for MongoDB 1.2.0 (2020-05-13)
      • Percona Backup for MongoDB 1.1.3 (2020-04-14)
      • Percona Backup for MongoDB 1.1.1 (2020-01-31)
      • Percona Backup for MongoDB 1.1.0 (2020-01-16)
      • Percona Backup for MongoDB 1.0.0 (2019-09-19)
      • Percona Backup for MongoDB 0.5.0 (2019-06-17)
    • Contribution guidelines
    • Copyright and licensing
    • Trademark policy

    • Usage example
    • Next steps
    • Useful links

    How Percona Backup for MongoDB works¶

    Even in a highly-available architecture, such as with MongoDB replication, backups are still required even though losing one server is not fatal. Whether for a complete or partial data disaster, you can use PBM (Percona Backup for MongoDB) to go back in time to the best available backup snapshot.

    Percona Backup for MongoDB is a command line interface. It provides the set of commands to manage backup and restore operations in your database.

    Usage example¶

    Let’s have a look at how Percona Backup for MongoDB works.

    With Percona Backup for MongoDB up and running in your environment, make a backup:

    $ pbm backup
    

    To save all events that occurred to the data between the backups, enable saving oplog slices:

    $ pbm config --set pitr.enabled=true
    

    Now, imagine that your web application’s update was released on February 7 at 03:00 UTC. By 15:23 UTC, someone realizes that this update has a bug that is wiping the historical data of any user who logged in. To remediate this negative impact on data, it’s time to roll back up to the time of the application’s update - up to February 7, 03:00 UTC.

    $ pbm list
    

    The output lists the valid time ranges for the restore. The desired time (February 7, 03:00 UTC) falls within the 2021-02-03T08:08:36Z-2021-02-09T12:20:23Z range, so let’s restore the database up to that time.

    Since the restore and saving oplog slices are exclusive operations and cannot run together, let’s stop the oplog slicing first:

    $ pbm config --set pitr.enabled=false
    

    Now, let’s restore the database:

    $ pbm restore --time 2021-02-07T02:59:59
    

    To be on the safe side, it is a good practice to make a fresh backup after the restore is complete.

    $ pbm backup
    

    This backup refreshes the timeline and serves as the base for saving oplog slices. To re-enable this process, run:

    $ pbm config --set pitr.enabled=true
    

    Next steps¶

    Install and get started with Percona Backup for MongoDB

    Useful links¶

    • PBM architecture
    • Backup types

    Contact Us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: March 29, 2023
    Created: March 29, 2023
    Percona LLC and/or its affiliates, © 2023
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.