Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
great tutorial. I would recommend that obviously, all writing to the mongodb database be stopped prior to doing the mongodump. Moreover, it may be necessary to increase the ulimit before doing the mongorestore, although the number of mongorestore threads can be limited using the “–numParallelCollections” flag . Anyway, these were a couple of the lessons that were learned when I had to do a similar process for a production system.
Nice! I created a backup ruby script a week ago mit mongodump. Here is my ruby solution in case one has to backup all existing databases.
mUser = ""
mPass = ""
$mongo = Mongo::Client.new(["localhost"], :user => mUser, :password = mPass)
$mongo.database_names.each do |db|
arg = "mongodump --db \"#{db}\""
arg << " -u \"#{mUser}\""
arg << " -p \"#{mPass}\""
arg << " --authenticationDatabase \"admin\""
arg << " -o /path/to/backup/"
`#{arg}`
end
You might also mention that a Backup-User (in case you do not use the root/admin user) with specific privilgeses can be created.
{
"_id" : ObjectId("foo"),
"user" : "backupUser",
"pwd" : "foo",
"roles" : [
"dbAdminAnyDatabase",
"readWriteAnyDatabase",
"clusterAdmin",
"backup"
]
}
Hi mongodump -d myDatabase -o ~/backups/first_backup is creating a blank of course is set the “myDatabase” to my database name. What seems to be the problem?
I also tried mongodump -o ~/backups/first_backup for all dbs and same thing too the same thing happens on my ubuntu14.04
Full disclosure: I work for Elefantos.
Backups are way more than just running a dump command, as any graceful degradation strategy, the devil is in the details.
I wrote a blog post investigating ‘backups’ as a subset of the graceful degradation strategy space (https://www.elefantos.com/blog/simple-complexity), and the gist is that there is no problem in making the actual backup, the complexity is the monitoring and retention policies that you need to implement in order to know if you can use it, in some sense: who watches the watchers.
To be honest from the stories I have heard from my friends and my own experience, I would say backups work about 30% of the time, which is quite horrifying. That is why if you can you should use external service like https://elefantos.com or https://ottomatik.io/ or use your cloud provider to keep your backups safe and monitored.