# PBM restore backup data from minIO

**URL:** <https://forums.percona.com/t/pbm-restore-backup-data-from-minio/27831>\
**Category:** Percona Backup for MongoDB\
**Tags:** mongodb, pbm\
**Created:** [January 17, 2024, 8:49am UTC](https://forums.percona.com/t/pbm-restore-backup-data-from-minio/27831 "2024-01-17T08:49:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phuong\_Tran](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/phuong_tran/32/14343_2.png) [@Phuong\_Tran](https://forums.percona.com/u/Phuong_Tran)\
**Post date:** [January 17, 2024, 8:49am UTC](https://forums.percona.com/t/pbm-restore-backup-data-from-minio/27831/1 "2024-01-17T08:49:30Z")

</div>

I’m using minIO to store the backup data that backup for a mongoDB replica set. In case, all nodes are down and lost, but the backup data still exists on minIO bucket storage, How can the new pbm-agent fetches and uses this backup data? or Which is suitable solution?

---

<div class="post-metadata">

**Author:** ![arlindo.neto](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/arlindo.neto/32/6930_2.png) [@arlindo.neto](https://forums.percona.com/u/arlindo.neto)\
**Post date:** [February 6, 2024, 12:32am UTC](https://forums.percona.com/t/pbm-restore-backup-data-from-minio/27831/2 "2024-02-06T00:32:42Z")

</div>

Hello Phuong,

There are two ways you can approach your restore:

**WITH PBM:**  
Create a new cluster (same number of nodes, same hardware from lost cluster), and configure PBM to connect to the new RS cluster.

PBM needs to access your s3 bucket location so it can restore your backup data. But it should be connected to the new cluster. Therefore, when running pbm config from your new environment, follow the [steps from the documentation](https://docs.percona.com/percona-backup-mongodb/install/initial-setup.html), but with 2 extra considerations:

1. You need to disable PITR, for safety (you want to restore PITR from the lost cluster, not the new one)

```auto
pitr:
  enabled: false

```

1. When running pbm config, you need to use an extra flag: `--force-resync`

Please check: [PBM commands - Percona Backup for MongoDB](https://docs.percona.com/percona-backup-mongodb/reference/pbm-commands.html#pbm-config) for more information

This should make the bucket with backups accessible from your new environment.

After this, you can follow pbm restore steps as detailed here: [Restore a backup - Percona Backup for MongoDB](https://docs.percona.com/percona-backup-mongodb/usage/restore.html) and re-enable PITR after restore is complete.

**WITHOUT PBM**

As long as you have access to the backups data (logical or physical) you can restore them in a new environment.

With logical backups, you can use **mongorestore** for restoring your dump files.

With physical backups, you have to manually copy datafiles from your bucket to all new mongo nodes, start each **mongod** process in [maintenance mode](https://www.mongodb.com/docs/manual/tutorial/perform-maintence-on-replica-set-members/) and change the replica set configuration object by editing [local.system.replset](https://www.mongodb.com/docs/manual/reference/local-database/#mongodb-data-local.system.replset) collection so it is compatible to your new servers. Much more time consuming, but still possible.

Please let us know if you have further questions.

Cheers!

> **[The local Database — MongoDB Manual](https://www.mongodb.com/docs/manual/reference/local-database/#mongodb-data-local.system.replset)**
