Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to grant permission for mongodb's mongodump

Tags:

mongodb

I'm trying to migrate my db over to a new machine. When I use mongodump in cmd it gives the error:

Failed: error dumping metadata: error creating directory for metadata file dump\margin_calls: mkdir dump: Access is denied.

I know I need to grant the 'backup' permission to allow this but I can't figure out how to do this.

EDIT: I thought this was quite an easy problem for someone familiar with the mongodb environment ?

like image 700
David Hancock Avatar asked Nov 09 '22 03:11

David Hancock


1 Answers

I ran into the same issue. It's because you do not have write permissions in the directory. You can change your command to:

    mongodump --out C:\Users\{YourUser}\Desktop

for example. So the backup dump is stored in a new folder in your desktop (change the path to store it in a different location).

Thanks to: https://stackoverflow.com/a/37510708/13811514 for the original post.

like image 92
Christoph Al Avatar answered Nov 15 '22 06:11

Christoph Al