When I create backup of all databases in MongoDB (version 3):
mongodump --username bacUser --password 12345
It\'s OK. But when I try to cre
If you are using mLab then it could be the version in your local mongo is not match with mLab. By default, Ubuntu will install mongo v2.x and mLab is v3.x. You could check with this command:
mongo --version
Install new mongo version:
sudo apt remove mongo-clients mongodb
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv D68FA50FEA312927
Create a list file for MongoDB.
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get install -y mongodb-org
Ref: https://docs.mongodb.com/v3.2/tutorial/install-mongodb-on-ubuntu/
Now you can dump your database with this command:
mongodump -h : -d -u -p -o