Skip to content

Instantly share code, notes, and snippets.

@ejhayes
Created July 16, 2014 23:27
Show Gist options
  • Save ejhayes/4f7aaefe73c3e7d2a769 to your computer and use it in GitHub Desktop.
Save ejhayes/4f7aaefe73c3e7d2a769 to your computer and use it in GitHub Desktop.
Installing mongo in OSX and importing data
#!/bin/bash
# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/
# unzip data
tar -xvzf <backup file in tgz or tar.gz format>
# install mongo
brew install mongo
# create data dir
sudo mkdir -p /data/db
# run the db (in one window)
sudo mongod --dbpath /data/db
# import the data
mongorestore <extracted data dir>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment