Make an snapshot-based backup¶
Before you start¶
- Install and set up Percona Backup for MongoDB
- Check that
pbm agent
is running with thepbm status
command -
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:
pbm status
to check the version of pbm-agentspbm version
to check the version of PBM CLI.
Procedure¶
-
To make a snapshot-based backup, run the
pbm backup
command with the typeexternal
:$ 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.
- opens the
-
(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. -
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. -
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¶
Useful links¶
Created: April 11, 2025