---
Allows you to backup and restore your Heroku database using your own private storage in S3. This allows circumventing the backup limit in Heroku plans and also gives peace of mind that your data is backed up somewhere else besides Heroku.
Tested only on Unix machines and Heroku Postgres 9.4.
## Installation
```bash
pip install elefant
```
Elefant's only dependencies are [`boto`](https://boto.readthedocs.org/en/latest/) in Python and, of course, `postgres` (use of `pg_restore`).
## Usage
Steps:
* Ensure AWS credentials are set up in environment variables for `boto`
* Ensure heroku is logged in with $ heroku login
Elefant will create an S3 bucket for you so long as it is not taken and your AWS user has the permissions to do so.
## Backup Format
You'll give `Elephant` both the name of your S3 bucket and the name of your Heroku app upon instantiation, and it will in turn store backup dumps with the following format:
<S3-BUCKET>/<HEROKU-APP-NAME>__%Y_%m_%d-%H_%M_%S.dump
where the formatting is [standard Python date formatting](https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior).
The filetype is a Postgres dump file, not a SQL text dump.
## Example
```python
from elefant import Elefant
# create Elefant object, passing in the Heroku app name and backups bucket
eft = Elefant("myapp", "mybucket")
print "Making backup, uploading to S3, and then deleting from Heroku..."
eft.backup()
print "Availiable backups:"
backups = eft.backups
for b in backups:
print b.name
print "Restoring from most recent backup..."
eft.restore(b)
print "Restoring from most recent backup using a string..."
eft.restore(b.name)
```
Metadata
Release files for Elefant 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Elefant-0.0.6.tar.gz | 4.0 kB | Without provenance | Details for Elefant-0.0.6.tar.gz |
Release files / Elefant-0.0.6.tar.gz
| Download URL | Elefant-0.0.6.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
979da348d75c5a0de4f9fa7ccd03c128e444369635ce3ec0180d896af959cd16
|
|
BLAKE2b-256 checksum How to use checksums |
909324da47463f388bd60ae33aadfde9ecd39e3d0ae55ecf670d6c6d425d2f7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for Elefant 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.