Skip to content

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

Make an snapshot-based backup

Before you start

  1. Install and set up Percona Backup for MongoDB
  2. Check that pbm agent is running with the pbm status command
  3. Check that all pbm-agents and PBM CLI have the same version. Otherwise we cannot guarantee successful backups and data consistency in them.

    To check the version, run the following commands:

Procedure

  1. To make a snapshot-based backup, run the pbm backup command with the type external:

    $ pbm backup -t external 
    

    When executing the command, PBM does the following:

    • opens the $backupCursor
    • prepares the database for file copy
    • stores the backup metadata on the storage and adds it to the files to copy
    • prints the prompt similar to the following:
    Ready to copy data from:
    <node-list>
    

    You also see the backup name.

  2. (Optional) You can check the backup progress with the pbm describe-backup. The command output provides the backup state and what nodes are running backup.

  3. At this stage, you need to copy the dataDir contents of each node in the <node-list> to the storage / make a snapshot using the technology of your choice.

  4. After the copy/snapshot is complete, run the following command to close the $backupCursor and finish the backup:

    $ pbm backup-finish <backup_name>
    

Next steps

List backups Make a restore


Last update: February 24, 2025
Created: February 24, 2025