Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

clone mongodb database to local machine

# Dump remote database to a local folder
mongodump --uri "mongodb+srv://username:password@host/mydb" --out ./myfolder

# Restore the database from the folder to localhost
mongorestore --port 27017 ./myfolder

# (Restore back to the remote)
mongorestore --host=example.com --port=27017 -u username -p password --db mydb ./myFolder
Comment

mongodb clone database

# Dump db to a local folder
mongodump mongodb://user:pwd@localhost/old_name -o ./dump 

# Restore the db with the new name
mongorestore mongodb://user:pwd@localhost -d new_name ./dump/old_name

# Try this flag if you get an authentication error
--authenticationDatabase admin
Comment

PREVIOUS NEXT
Code Example
Shell :: react slick typescript 
Shell :: docker wordpress plugins permissions 
Shell :: install torchtext 
Shell :: error mounting /dev/sdb1 at /media/ 
Shell :: remove git from folder windows 
Shell :: install en_web_core md 
Shell :: No Xcode or CLT version detected! 
Shell :: git remove tracked files without deleting 
Shell :: ionic capacitor v3 run android livereload 
Shell :: Install yarn via npm global 
Shell :: chromium for linux 
Shell :: imagemagick convert heic to jpg mac 
Shell :: powershell beeb 
Shell :: how to undo git remote add origin 
Shell :: gpu name command line linux 
Shell :: mac os check network ip 
Shell :: git track filename capitalisation 
Shell :: uninstall in linux 
Shell :: como desistalar o code visual code linux 
Shell :: force remove directory windows 
Shell :: command to check working of gpu in linux 
Shell :: bash for file in folder 
Shell :: install openjdk ubuntu 
Shell :: how to install netbeans on ubuntu 20.04 
Shell :: fatal: refusing to merge unrelated histories 
Shell :: windows install chocolatey 
Shell :: remove ppa from ubuntu 
Shell :: linux test if string exists in file 
Shell :: install vs code in ubuntu 
Shell :: ubuntu get partition list 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =