Search code examples
databasemongodbmongodb-querybackupmongodump

Is there a way to exclude a database from mongodump


I am using mongodump for daily backups. In my database server i have many DBs, I want to exclude huge DB from dumping. e.g : dump all DBs except 'Db_name', something like : mongoump --out /data/backup --excludeDatabase='name_of_db'


Solution

  • You can't exclude the databases for mongodump command still in a feature request accepted state. I would suggest writing a script to individually backup required databases and using excludeCollectionsWithPrefix if you can identify a pattern to exclude the collections