What about the best practice for backup and restore sharded cluster

Hi there!
I have two questions about backup and restore sharded cluster:

  1. I have replicaset. Replicaset comprises primary, secondary and arbiter.
    I create a new sharded cluster and i want to move data from the replicaset to the sharded cluster.
    How can i do it? Maybe there are best practices for this?

  2. What is the best way for backup and restore sharded cluster without using MongoDB Atlas, MongoDB Cloud Manager, MongoDB Ops Manager?

Thank you for your answers

Hi,
Are you going to move a ReplicaSet to a new Shared Cluster?
You can transfer your Replica set to a new cluster: Replica Set to Replica Set (backup/restore or extend your old RS cluster by nodes from a new cluster, sync the data, switch primary to the new cluster, remove old RS members ), at the end you can convert it to a sharded cluster.
Convert a Replica Set to a Sharded Cluster

regarding the best way to backup and restore sharded cluster without using MongoDB Atlas, MongoDB Cloud Manager, or Ops Manager - you can use LVM snapshots, please read:
Backup and Restore Sharded Clusters

2 Likes

Thank you for your answer!
I want to exactly move the data from the replicaset to the new sharded cluster
expected result:
i want to have a replicaset and a sharded cluster with same data

In the beginning, I would create a new cluster as a Replica Set, move data from the old RS to the new RS (see my first post) and convert new RS to a shared cluster Convert a Replica Set to a Sharded Cluster

2 Likes

Thank you a lot! i got you)

1 Like

hi!
i read this https://www.mongodb.com/docs/manual/tutorial/backup-sharded-cluster-with-filesystem-snapshots/
and i found that:

In MongoDB 4.2+, you cannot use file system snapshots for backups that involve transactions across shards because those backups do not maintain atomicity. Instead, use one of the following to perform the backups:

if i uderstand i can’t use LVM snapshots

it is for backups that involve transactions across shards, are you using multi-document transactions across shards in your application?

oh, no we don’t need multi-document transactions, okay, thank you again

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.