Skip to content

Rate this page
Thanks for your feedback
Thank you! The feedback has been submitted.

Get free database assistance or contact our experts for personalized support.

Restore to a new cluster with different replica set names

Version added: 1.22.0

You can restore from a backup to a cluster that has different replica set names. The number of shards in the target cluster depends on the restore type:

  • For logical restores, the target cluster can have the same number of shards as the source where the backup was taken, or more.
  • For physical and incremental restores, the number of shards in the target cluster must be exactly the same as in the source cluster.

Before you begin

  1. Make sure that the cluster is running.

  2. Export your namespace as an environment variable. Replace the <namespace> placeholder with your value:

    export NAMESPACE = <namespace>
    
  3. Get the backup information. List the backups using this command:

    kubectl get psmdb-backup -n $NAMESPACE
    
  4. Get cluster information. List available clusters using this command:

    kubectl get psmdb -n $NAMESPACE
    

To restore data to the cluster with different replica set names, configure the name mapping for the replsetRemapping subsection in the restore configuration file. Specify each source replica set name as a key, and set the target replica set name as the value

Here’s the example configuration:

...
metadata:
  name: restore1
spec:
  clusterName: my-cluster-name
  backupName: backup1
  replsetRemapping:
    sourceRs0: targetRs0
    sourceRs1: targetRs1

Apply the configuration to start the restore:

kubectl apply -f deploy/backup/restore.yaml

With this ability you extend the list of environments suitable for the restore lifting the limitation for the target cluster to have the same configuration.


Last update: February 25, 2026
Created: February 25, 2026