User Tools

Site Tools


tech:mongodb:start

MongoDB

original ...

mongodump command dumps everything into the directory given by -o argument in BSON format.

mongodump -h ${HOSTNAME} -u ${DBUSER} -p ${DBPASS} -d ${DBNAME} -o /srv/app/mongo

Note that the following expressions are environment variables defined in bash terminal: -h ${HOSTNAME} -u ${DBUSER} -p ${DBPASS} -d ${DBNAME}

mongorestore command reads all BSON files in the directory and restores the database.

mongorestore -h ${HOSTNAME} -u ${DBUSER} -p ${DBPASS} --db ${DBNAME} /srv/app/mongo

Links: techmain

tech/mongodb/start.txt · Last modified: 2021/11/13 09:53 by rk4n3