bpgasil.blogg.se

Leanote mongodb dump restore
Leanote mongodb dump restore














T06:48:56.712+0000 have successfully backup and restore from dockerised MongoDB instance. T06:48:56.698+0000 creating collection mydb.movie using options from metadata T06:48:56.688+0000 creating collection test.product using options from metadata T06:48:56.688+0000 reading metadata for test.product from /tmp/test/ T06:48:56.688+0000 found collection metadata from test.product to restore to test.product T06:48:56.688+0000 found collection test.product bson to restore to test.product T06:48:56.687+0000 found collection metadata from mydb.movie to restore to mydb.movie T06:48:56.687+0000 found collection mydb.movie bson to restore to mydb.movie T06:48:56.687+0000 found collection metadata from to restore to T06:48:56.687+0000 found collection bson to restore to T06:48:56.687+0000 preparing collections to restore from docker run -it -rm -link mongo:mongo -v /tmp/mongodump:/tmp mongo bash -c 'mongorestore -v -host $MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT /tmp' T06:36:47.790+0000 done dumping test.product (1 ls -ltrh /tmp/mongodump/ĭrwxr-xr-x 2 root root 4.0K May 23 12:06 testĭrwxr-xr-x 2 root root 4.0K May 23 12:06 mydbĭrwxr-xr-x 2 root root 4.0K May 23 12:06 of MongoDB database illustrated below. We know this, because we didn’t provide any host, port, authentication information, etc.

leanote mongodb dump restore

T06:36:47.789+0000 dumping up to 3 collections in parallel The following command restores all databases that have been backed up to the dump/ directory: mongorestore dump/ This example restores the databases to the local instance running on the default port 27017. docker run -it -rm -link mongo:mongo -v /tmp/mongodump:/tmp mongo bash -c 'mongodump -v -host $MONGO_PORT_27017_TCP_ADDR:$MONGO_PORT_27017_TCP_PORT -out=/tmp' docker psĬONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESĢ1ea276f002e mongo "docker-entrypoint." 46 seconds ago Up 2 seconds 0.0.0.0:27017->27017/tcp of MongoDB database illustrated below.

#Leanote mongodb dump restore install#

Please visit my blog previous blog Install MongoDB Docker to setup docker. MongoDB backup and restore from docker container is pretty easy.














Leanote mongodb dump restore