# POC try restore on same node PBM\_REPLSET\_REMAPPING

**URL:** <https://forums.percona.com/t/poc-try-restore-on-same-node-pbm-replset-remapping/20325>\
**Category:** Percona Backup for MongoDB\
**Created:** [February 27, 2023, 2:21pm UTC](https://forums.percona.com/t/poc-try-restore-on-same-node-pbm-replset-remapping/20325 "2023-02-27T14:21:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbas](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@dbas](https://forums.percona.com/u/dbas)\
**Post date:** [February 27, 2023, 2:21pm UTC](https://forums.percona.com/t/poc-try-restore-on-same-node-pbm-replset-remapping/20325/1 "2023-02-27T14:21:08Z")

</div>

Hello,

For a POC I try to restore on same node on which I configured two replica set, below massage is returned :  
Exit: connect to the node: connect: create mongo client: a direct connection cannot be made if multiple hosts are specified

Is it possible ?

I have change the conf pbm for target replicaset and below error is returned :  
pbm restore 2023-02-22T13:09:06Z --replset-remapping=“rstarget=rsA,rssource=rsB”  
Starting restore 2023-02-27T16:48:49.031699495Z from ‘2023-02-22T13:09:06Z’…Error: extra/unknown replica set found in the backup: rssource

- Restore on replicaset “rstarget” in state: error: extra/unknown replica set found in the backup: rssource

Thank you

Best regards

---

<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 28, 2023, 9:07am UTC](https://forums.percona.com/t/poc-try-restore-on-same-node-pbm-replset-remapping/20325/2 "2023-02-28T09:07:30Z")

</div>

Hi @dbas,

1. `a direct connection cannot be made if multiple hosts are specified` - this error can occur when `PBM_MONGODB_URI` env var or `--mongodb-uri` flag contains multiple hosts like `mongodb://rs0:30000,rs1:30100/`. Just provide a single host URI to any node of the replset/shard.

2. `extra/unknown replica set found in the backup` - this happens when a backup has replset(s)/shard(s) not present in the target/restore cluster. From your description, the `rssource` replset/shard is absent in the cluster.  
I guess you what to restore data from `rssource` to `rsB` and `rstarget` to `rsA`. In this case, try `--replset-remapping="rsA=rstarget,rsB=resource"`.

The `--replset-remapping` flag has similar semantics to docker port publishing: `$to_target=$from_source`.

Additionally, the target cluster can have more shards than in a backup. But all shards from the backup should be assigned/targeted to their shard. Otherwise, PBM cannot know to where restore shard data from the backup.

More details you can find under section “One More Thing: Possible Misconfiguration” in [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/) blog post

If you still have a problem, please let us know.

---

<div class="post-metadata">

**Author:** ![dbas](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@dbas](https://forums.percona.com/u/dbas)\
**Post date:** [February 28, 2023, 1:13pm UTC](https://forums.percona.com/t/poc-try-restore-on-same-node-pbm-replset-remapping/20325/3 "2023-02-28T13:13:07Z")

</div>

For a POC I try to restore on same node on which I configured two replica set, below massage is returned :

pbm restore 2023-02-22T13:09:06Z --replset-remapping=“rsA=rstarget,rsB=rssource”

- Restore on replicaset “rstarget” in state: error: extra/unknown replica set found in the backup: rsB

Is it possible to restore backup from replicaset to another replicaset with replset-remapping ?

Thank you

Best regards

---

<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 28, 2023, 1:35pm UTC](https://forums.percona.com/t/poc-try-restore-on-same-node-pbm-replset-remapping/20325/4 "2023-02-28T13:35:54Z")

</div>

Could you please send the output of the following commands:

1. `mongosh "$MONGOS_URI" --quiet --eval 'db.adminCommand("getShardMap").map'`
2. `pbm describe-backup "2023-02-22T13:09:06Z"`

---

<div class="post-metadata">

**Author:** ![dbas](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@dbas](https://forums.percona.com/u/dbas)\
**Post date:** [February 28, 2023, 1:45pm UTC](https://forums.percona.com/t/poc-try-restore-on-same-node-pbm-replset-remapping/20325/5 "2023-02-28T13:45:11Z")

</div>

Thank you there are two replica sets whithout sharding :  
[root@srvpoc backup]# mongosh “$MONGOS\_URI” --quiet --u admin --p --eval ‘db.adminCommand(“getShardMap”).map’  
Enter password: \*\*\*\*\*\*\*\*\*  
MongoServerError: Sharding is not enabled  
[root@srvpoc backup]# pbm describe-backup “2023-02-22T13:09:06Z”  
name: “2023-02-22T13:09:06Z”  
opid: 63f613f2edec2486f02740af  
type: logical  
last\_write\_time: “2023-02-22T13:09:10Z”  
last\_transition\_time: “2023-02-22T13:09:15Z”  
mongodb\_version: 6.0.4  
pbm\_version: 2.0.3  
status: done  
size\_h: 200.9 KiB  
replsets:

- name: rssource  
status: done  
last\_write\_time: “2023-02-22T13:09:10Z”  
last\_transition\_time: “2023-02-22T13:09:14Z”

Thank you

Regards

---

<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 28, 2023, 1:50pm UTC](https://forums.percona.com/t/poc-try-restore-on-same-node-pbm-replset-remapping/20325/6 "2023-02-28T13:50:50Z")

</div>

The backup contains data for “rssource” replset only.  
I guess your target replset name is “rstarget” ?

If so, please try  
`pbm restore "2023-02-22T13:09:06Z" --replset-remapping="rstarget=rssource"`

---

<div class="post-metadata">

**Author:** ![dbas](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@dbas](https://forums.percona.com/u/dbas)\
**Post date:** [February 28, 2023, 2:00pm UTC](https://forums.percona.com/t/poc-try-restore-on-same-node-pbm-replset-remapping/20325/7 "2023-02-28T14:00:00Z")

</div>

Hello,

Perfect this is a solution

Thank you

best regards
