Skip to content

HackterSSV/dump-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 

Repository files navigation

dump-database

dump is export and import data in database from old database to new database. You can use it with move from dev database to uat or to production

How to dump and restore database mongodb

install mongodb tool ()

how to dump database (export your database)

  1. open terminal
  2. use command: mongodump --uri="your database url"

example dump all database from url:

C:\Users\ter> mongodump --uri="mongodb+srv://hackter77:%3CZPnaI2z 0bvBrgE4G%3E@cluster0.7xduomn.mongodb.net/?retryWrites=true&w=majority"

example dump single database from url:

C:\Users\ter> mongodump --uri="mongodb+srv://hackter77:%3CZPnaI2z0bvBrgE4G%3E@cluster0.7xduomn.mongodb.net/database1?retryWrites=true&w=majority"

you can check your database after dump database in the path you use command

example my dump: C:\Users\ter\dump\

how to restore database(import dump data to new database)

restore all database to new database from folder dump:

C:\Users\ter>mongorestore --uri="mongodb+srv://hackter77:%3CZPnaI2z 0bvBrgE4G%3E@cluster0.7xduomn.mongodb.net/?retryWrites=true&w=majority" dump\

restore single database to new database from folder dump\your database:

C:\Users\ter>mongorestore --uri="mongodb+srv://hackter77:%3CZPnaI2z0bvBrgE4G%3E@cluster0.7xduomn.mongodb.net/database2?retryWrites=true&w=majority" dump\database1\

About

dump is export and import data in database from old database to new database.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors