I have the bellow MongoDB sharding with the following configuration :
Is it possible to migrate Data from zone01 to zone02 ?
I tried to remove range and recreate it again but i got duplicate data in the both shards/zones.
In fact the process of migration was in progress after few time the data moves from shard01 to shard02 progressively, bellow the commands i used for that :
1- Remove the current ranges
sh.removeRangeFromZone("db2017.collection01", { num: 0 }, { num: 10 })
sh.removeRangeFromZone("db2017.collection01", { num: 11 }, { num: 20 })
2- Recreate the new ranges with different zones :
sh.addTagRange("db2017.collection01", { num: 1 }, { num: 10 }, "zone02")
sh.addTagRange("db2017.collection01", { num: 11 },{ num: 20 }, "zone01")
Just give sometime to your MongoDB it will migrate automatically your data between shards.