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
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.
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.