Skip to main content

Utility for synchronizing parallel PostgreSQL databases on Heroku, local, and remote servers

Project description

Build Status Coverage Status PyPI Version Supported Versions Downloads

Utility for synchronizing parallel PostgreSQL databases on Heroku, local, and remote servers

Features

Easily copy databases between locations, e.g.:

  • Initialize a Heroku database with local data

  • Update local development database with the latest data in your Heroku app

  • Update one Heroku app (e.g. staging) with the data from another app (e.g. production)

Installation

You can get paragres from PyPI with:

pip install paragres

The development version can be installed with:

pip install -e git://github.com/jessamynsmith/paragres.git#egg=paragres

If you are developing locally, your version can be installed from the working directory with:

python setup.py.install

Use

Note 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-pgbackups

Example 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.py

Example 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:

Destination

postgres

Heroku app

Source

local file

X

postgres

X

X *

url

X

X

Heroku app

X

X

* Can only push from a database accessible to the local user, or accessible to a user configured via PG* environment variables

Development

Fork the project on github and git clone your fork, e.g.:

git clone https://github.com/<username>/paragres.git

Create a virtualenv and install dependencies:

mkvirtualenv paragres
pip install -r requirements/package.txt -r requirements/test.txt

Run tests and view coverage:

coverage run -m nose
coverage report

Check code style:

flake8

Install your local copy:

python setup.py.install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paragres-0.6.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file paragres-0.6.tar.gz.

File metadata

  • Download URL: paragres-0.6.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for paragres-0.6.tar.gz
Algorithm Hash digest
SHA256 9977d975bc3ef3455716654e8eefc052fb60d83e975688a933c6c9022b3cf28b
MD5 d6ffe28c3842e860d7d2302685377759
BLAKE2b-256 03dc4f38482c251576be1f7bc56df1b0c6dd556dabdac78e25f112f7f540b578

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page