# Need to run sh.stopBalancer() during mongosync process

**URL:** <https://forums.percona.com/t/need-to-run-sh-stopbalancer-during-mongosync-process/37788>\
**Category:** MongoDB® General Discussion\
**Created:** [May 1, 2025, 11:56am UTC](https://forums.percona.com/t/need-to-run-sh-stopbalancer-during-mongosync-process/37788 "2025-05-01T11:56:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kay\_Khan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kay_khan/32/17023_2.png) [@Kay\_Khan](https://forums.percona.com/u/Kay_Khan)\
**Post date:** [May 1, 2025, 11:56am UTC](https://forums.percona.com/t/need-to-run-sh-stopbalancer-during-mongosync-process/37788/1 "2025-05-01T11:56:26Z")

</div>

We are attempting to migrate our existing mongodb replicaset to a mongodb sharded replicaset.

We are doing a continous replication migration using mongosync [Sync a Replica Set to a Sharded Cluster - MongoDB Mongosync - MongoDB Docs](https://www.mongodb.com/docs/cluster-to-cluster-sync/current/topologies/rs-to-sharded/)

However we are gettign the following error

```auto
{"success":false,"error":"APIError","errorDescription":"failed to confirm that the destination’s shard balancer does not affect migrated collections: detected unsupported balancer status: the destination cluster's balancer is turned on. See https://www.mongodb.com/docs/cluster-to-cluster-sync/current/reference/mongosync/mongosync-behavior/#cluster-and-collection-types for mongosync's balancer requirements and limitations"}

```

The documentation suggests we need to stop the balancer whilst the sync is happening - [mongosync Behavior - MongoDB Mongosync - MongoDB Docs](https://www.mongodb.com/docs/cluster-to-cluster-sync/current/reference/mongosync/mongosync-behavior/#cluster-and-collection-types)

However when i run `sh.stopBalancer()` it appears to apply momentarily but then gets reversed back ( monitoring sh.getBalancerState())

Im wondering if there is a limitation with percona mongodb preventing us from doing this?

---

<div class="post-metadata">

**Author:** ![Kay\_Khan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kay_khan/32/17023_2.png) [@Kay\_Khan](https://forums.percona.com/u/Kay_Khan)\
**Post date:** [May 1, 2025, 12:04pm UTC](https://forums.percona.com/t/need-to-run-sh-stopbalancer-during-mongosync-process/37788/2 "2025-05-01T12:04:08Z")

</div>

Ah i just saw this - perhaps i need to disable it from here - [percona-helm-charts/charts/psmdb-db/values.yaml at main · percona/percona-helm-charts · GitHub](https://github.com/percona/percona-helm-charts/blob/main/charts/psmdb-db/values.yaml#L345)

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [May 15, 2025, 12:13pm UTC](https://forums.percona.com/t/need-to-run-sh-stopbalancer-during-mongosync-process/37788/3 "2025-05-15T12:13:21Z")

</div>

correct, if the balancer is manually stopped but the Operator parameter has it enabled, then it will be restarted automatically by the Operator
