Package: paragres
Utility for synchronizing parallel PostgreSQL databases on Heroku,
local, and remote serversLike my work? Tip me!https://www.paypal.me/jessamynsmithFeaturesEasily copy databases between locations, e.g.:Initialize a Heroku database with local dataUpdate local development database with the latest data in your Heroku appUpdate one Heroku app (e.g. staging) with the data from another app (e.g. production)InstallationYou can get paragres from PyPI with:pip install paragresThe development version can be installed with:pip install -e git://github.com/jessamynsmith/paragres.git#egg=paragresIf you are developing locally, your version can be installed from the
working directory with:python setup.py.installUsageNote 1: To use paragres to access a Heroku app, you must be logged into the Heroku account that
owns that app.Note 2: By default, Heroku’s new pg:backups command is used. if you want to use the old pgbackups
addon, you must specify –use-pgbackupsExample 1, copying data between Heroku databases:paragres -s <source_heroku_app_name> -d <destination_heroku_app_name>Example 2, copying a new backup snapshot of data from a Heroku database
to localhost:paragres -s <heroku_app_name> -c -t path/to/db_settings.pyExample 3, creating a backup snapshot of a Heroku database:paragres -c -s <heroku_app_name>db_settings.py must contain at least the following (Django settings
file format):DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': '<db_name>',
        'USER': '<username>',
        'PASSWORD': '<password>',
        'HOST': '<host>',
        'PORT': '<port>',
    }
}Supported transfers:DestinationpostgresHeroku appSourcelocal fileXpostgresXX *urlXXHeroku appXX* Can only push from a database accessible to the local user, or
accessible to a user configured via PG* environment variablesFull list of optional arguments:-h,--helpshowthishelpmessageandexit--versionShowprogram's version number
-f FILE, --file FILE  PostgreSQL dump file to use as a data source
-u URL, --url URL     Public URL from which to pull db file
-s SOURCE_APP, --source-app SOURCE_APP
                      Heroku app from which to pull db
-c, --capture         Capture a new Heroku backup
-o SOURCE_SETTINGS, --source-settings SOURCE_SETTINGS
                      Django-style settings file with database connection information for source database
                      (or 'DJANGO_SETTINGS_MODULE' to use that environment variable'svalue)-bSOURCE_DBNAME,--source-dbnameSOURCE_DBNAMESourcedatabasename(overridesvalueinsourcesettingsifbotharespecified)-dDESTINATION_APP,--destination-appDESTINATION_APPHerokuappforwhichtoreplacedb-tSETTINGS,--settingsSETTINGSDjango-stylesettingsfilewithdatabaseconnectioninformationfordestinationdatabase(or'DJANGO_SETTINGS_MODULE'tousethatenvironmentvariable'svalue)-nDBNAME,--dbnameDBNAMEDestinationdatabasename(overridesvalueinsettingsifbotharespecified)-vVERBOSITY,--verbosityVERBOSITYVerbositylevel:0=minimaloutput,1=normaloutput--use-pgbackupsUsethedeprecatedpgbackupsaddonratherthanHerokupg:backupsDevelopmentFork the project on github and git clone your fork, e.g.:git clone https://github.com/<username>/paragres.gitCreate a virtualenv and install dependencies:mkvirtualenv paragres
pip install -r requirements/package.txt -r requirements/test.txtRun tests with coverage (should be 100%) and check code style:coverage run -m nose
coverage report -m
flake8Verify all supported Python versions:pip install tox
toxInstall your local copy:python setup.py install