/mongodb-dumper

Provide making dumps with docker images' help

Primary LanguageShell

Docker mongodb dumper

To dump database:

./dump.sh -h YOUR_HOST

There are several additional options:

-h (required) -- host name
-p            -- port
-d            -- database name; if not set - all database will be dumped
-o            -- additional options for mongodump command; wrap in double quotas all the options

As a result you have db dump in the current folder.

To restore database:

./restore.sh -f PATH_TO_FILE -h YOUR_HOST

There are several additional options:

-f (required) -- path to file
-h (required) -- host name
-p            -- port
-o            -- additional options for mongorestore command; wrap in double quotas all the options

You can always see help info by run command with option --help:

./restore.sh --help

Inspired by Ferikl