POC try restore on same node PBM_REPLSET_REMAPPING

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

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 blog post

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

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

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"

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

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"

Hello,

Perfect this is a solution

Thank you

best regards