Giter Club home page Giter Club logo

heroku-mongo-sync's Introduction

Heroku - Mongo Sync

This is a plugin for the Heroku command line, adding commands to sync your local and production mongo databases.

It was tested and should just work with Mongolab or Mongo HQ. If you host your mongo db somewhere else, just make sure you have access from your local machine.

About this fork

Thanks to pedro for creating the plugin, and for bitzesty for improving it. This fork fixes all the deprecated warnings.

Installation

$ heroku plugins:install http://github.com/rossbeale/heroku-mongo-sync.git

Usage

Get a copy of your production database with:

$ heroku mongo:pull
Please input local mongodb name: db
Replacing the myapp db at localhost with genesis.mongohq.com
Syncing users (4)... done
Syncing permissions (4)... done
Syncing plans (17)... done

Update your production database with:

$ heroku mongo:push
Please input local mongodb name: db
THIS WILL REPLACE ALL DATA for app ON mongodb://blahblah WITH mongodb://localhost:27017/db
Are you sure? (y/n) y
Syncing users (4)... done
Syncing permissions (4)... done
Syncing plans (17)... done

As usual, in case you're not inside the app checkout you can specify the app you want to pull/push to:

$ heroku mongo:pull --app myapp-staging

If you're inside a checkout with multiple apps deployed, you can also specify the one to pull/push to by the git remote:

$ heroku mongo:pull --remote staging

Notes

Created by Pedro Belo. Support for indexes, users and more added by Ben Wyrosdick. Fixed up by Ross Beale.

Use at your own risk.

heroku-mongo-sync's People

Contributors

benwyrosdick avatar kaievns avatar ma11hew28 avatar matthewford avatar micahbrich avatar oma avatar padraicm avatar rossbeale avatar tiendung avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.