Skip to content

Provide making dumps with docker images' help on a running mongo container

Notifications You must be signed in to change notification settings

atistrcsn/mongodb-dumper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker mongodb dumper

To dump database:

./dump.sh -c RUNNING_MONGO_CONTAINER_NAME

There are several additional options:

-c (required) -- running mongo container 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 -c RUNNING_MONGO_CONTAINER_NAME

There are several additional options:

-f (required) -- path to file
-c (required) -- running container 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

About

Provide making dumps with docker images' help on a running mongo container

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%