Answers for "clone data mongo"

1

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
Posted by: Guest on January-10-2021

Code answers related to "clone data mongo"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language