Qual é a sua dúvida?
Mongodb Backup Restore
Mongo Backup
Backup local
$ mongodump --out "[FILENAME]"
ex:
$ mongodump --out "mongo.bkp"
Backup Remoto
$ mongodump -h [IP]:[PORT] -d [DATABASE] --out "[FILENAME]"
ex:
$ mongodump -h 172.17.0.3:27017 -d products --out "mongo.bkp"
Backup remoto passando usuario e senha
$ mongodump -h [IP]:[PORT] -u [USER] -p [PASS] -d [DATABASE] --out "[FILENAME]"
Ex:
$ mongodump -h 172.17.0.3:27017 -u fabricio -pass 123456 -d products --out "mongo.bkp"
Mongo Restore
$ mongorestore -h [IP]:[PORT] -u [USER] -p [PASS] -d [DATABASE] "[FILENAME]"
Ex:
$ mongorestore -h 172.17.0.3:27017 -u fabricio -pass 123456 -d products "mongo.bkp"
Mongo Import
Ao exportar uma collection pelo Mongo Express, ela deve ser importado seguindo os seguintes modelos
Import Simple Json
$ mongoimport -h IP:PORT --db DATABASE_NAME --file FILE_NAME
Import JsonArray
$ mongoimport -h IP:PORT --db DATABASE_NAME --file FILE_NAME.json --jsonArray
Setting the Collection name
$ mongoimport -h IP:PORT --db DATABASE_NAME --collection COLLECTION_NAME --file FILE_NAME.json --jsonArray