How to restore backup on new env via diff replica set name?

Hi Guys,

am try to restore the backup on new mongo replica set.

Just copied all the backup file including the meta json file on target server as below:

INFRA [mongo@wqdcsrv3062 local_backups]# ls -lhtr
total 12K
drwx------ 3 mongo mongo 28 Feb 21 10:42 2023-02-21T02:17:22Z
drwx------ 3 mongo mongo 28 Feb 21 10:43 2023-02-21T02:28:56Z
-rw------- 1 mongo mongo 1.7K Feb 21 11:28 2023-02-21T02:17:22Z.pbm.json
-rw------- 1 mongo mongo 2.3K Feb 21 11:28 2023-02-21T02:28:56Z.pbm.json

Run the backup list command:

INFRA [mongo@wqdcsrv3062 ~]# /opt/percona/percona-backup-mongodb-2.0.3/pbm list --replset-remapping=mongo24004=MongoCapp24004
Backup snapshots:


Even I add the parameter --replset-remapping, but no backup info found.

How to resolve it ?


Hi @JasonTJ,

In short, run pbm config --force-resync and try again.

Just copying backup files is not enough. You need to setup PBM config with proper storage settings. All agents must have access and the same RW permissions to the storage. Then run pbm config --force-resync.

PBM does not lookup to configured storage every time. Commands like status, list etc use info in MongoDB first. config --force-resync populates the information.

The replset-remapping feature was designed to use original storage without coping.

There is blog post with some details at the end Moving MongoDB Cluster to a Different Environment with Percona Backup for MongoDB

@Dmytro_Zghoba Thanks Bro! It works for your parameter!

INFRA [mongo@wqdcsrv3062 ~]# /opt/percona/percona-backup-mongodb-2.0.3/pbm config --file pbm_config_new.yaml --force-resync
Storage resync started
INFRA [mongo@wqdcsrv3062 ~]# /opt/percona/percona-backup-mongodb-2.0.3/pbm list
Backup snapshots:
2023-02-21T02:17:22Z [restore_to_time: 2023-02-21T02:17:43Z]
2023-02-21T02:28:56Z [restore_to_time: 2023-02-21T02:28:58Z]