nie-ine / inseri

inseri serves as an online collaborative work and publish environment.
https://nie-ine.github.io/inseri
Other
13 stars 4 forks source link

How do you backup the mongodb? #512

Closed janCstoffregen closed 4 years ago

janCstoffregen commented 4 years ago
  1. make sure you have go installed follow that link if you do not have it https://golang.org/doc/install

  2. download the mongodb tools from the following link https://www.mongodb.com/try/download/database-tools?tck=docs_databasetools

  3. unzip the folder then navigate the folder cd mongotools/

  4. you find a bin folder that contains many binaries among them you find mongodump

  5. make mongodump as a trusted application (by trying to double click it won't open so go to security and privacy in the setting of your mac you will find that mongodump tried to run make click on open anyway and put your password)

  6. go to the terminal to the location where the unzipped mongotools/bin exist

  7. run the following command ./mongodump --db="databasename" --uri="mongodb+srv://"username":"password"@"host"/"databasename"?retryWrites=true&w=majority" --out="destination folder"

janCstoffregen commented 4 years ago

and how do you convert bson to json?

janCstoffregen commented 4 years ago

https://stackoverflow.com/a/34630398/7398755

janCstoffregen commented 4 years ago

thanks @OmniaKahla works great!!!