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

**URL:** <https://forums.percona.com/t/how-to-restore-backup-on-new-env-via-diff-replica-set-name/20210>\
**Category:** Percona Backup for MongoDB\
**Created:** [February 21, 2023, 4:13am UTC](https://forums.percona.com/t/how-to-restore-backup-on-new-env-via-diff-replica-set-name/20210 "2023-02-21T04:13:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JasonTJ](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@JasonTJ](https://forums.percona.com/u/JasonTJ)\
**Post date:** [February 21, 2023, 4:13am UTC](https://forums.percona.com/t/how-to-restore-backup-on-new-env-via-diff-replica-set-name/20210/1 "2023-02-21T04:13:02Z")

</div>

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:

PITR :

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

How to resolve it ?

Thanks  
Jason

---

<div class="post-metadata">

**Author:** ![Dmytro\_Zghoba](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dmytro_zghoba/32/4721_2.png) [@Dmytro\_Zghoba](https://forums.percona.com/u/Dmytro_Zghoba)\
**Post date:** [February 21, 2023, 6:24am UTC](https://forums.percona.com/t/how-to-restore-backup-on-new-env-via-diff-replica-set-name/20210/2 "2023-02-21T06:24:08Z")

</div>

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](https://www.percona.com/blog/moving-mongodb-cluster-to-a-different-environment-with-percona-backup-for-mongodb/)

---

<div class="post-metadata">

**Author:** ![JasonTJ](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@JasonTJ](https://forums.percona.com/u/JasonTJ)\
**Post date:** [February 21, 2023, 6:40am UTC](https://forums.percona.com/t/how-to-restore-backup-on-new-env-via-diff-replica-set-name/20210/3 "2023-02-21T06:40:33Z")

</div>

@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]

---

<div class="post-metadata">

**Author:** ![dcamarena](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dcamarena/32/8008_2.png) [@dcamarena](https://forums.percona.com/u/dcamarena)\
**Post date:** [October 3, 2023, 9:27am UTC](https://forums.percona.com/t/how-to-restore-backup-on-new-env-via-diff-replica-set-name/20210/4 "2023-10-03T09:27:06Z")

</div>

Hi,

I had the same problem, but `pbm --force-resync` didn’t help. PITR must be OFF that a resync works. I turned it off with `pbm config --set pitr.enabled=false` and then the resync worked.  
Just in case anyone else has the same problem.
