Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have one case where i create db for Daily data. I have some collections in this db which are sharded. My requirement is as follows: Create every day DB If There is a DB which is more than 7 days old take its dump in some location and delete it from live DB.

I have one question how can i check if chunk transfer/balancing was completed for this DB before taking its dump and deleting it. I am concern if i delete the DB whose chinks were not transferred completed will it corrupt my system

Regards Virendra Agarwal

share|improve this question
up vote 1 down vote accepted

To ensure there are no migrations in progress while taking your backup, you should stop the balancer via sh.stopBalancer(). Any in-progress migrations will be completed before the balancer is disabled.

If you want to ensure the balancer is stopped before taking your backup, you can run the following in the mongo shell, which should return true:

 !sh.getBalancerState() && !sh.isBalancerRunning()

After taking your backup, you need to remember to start the balancer again.

share|improve this answer
Thats a great answer – viren Aug 25 '14 at 9:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.