Backing up and restoring Postgres databases using S3 for automation
Project description
elefant
---
Allows you to backup and restore your Heroku database using your own private storage in S3. This allow 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 dependency is `boto`.
## 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.
## Example
```python
from elefant import Elefant
# create Elefant object, passing in the Heroku app name
hb = Elefant("myapp", "muybucket")
print "Making and backup and uploading to S3..."
hb.backup()
print "Availiable backups:"
backups = hb.backups
for b in backups:
print b.name
print "Restoring from most recent backup..."
hb.restore(b)
print "Restoring from most recent backup using a string..."
hb.restore(b.name)
```
---
Allows you to backup and restore your Heroku database using your own private storage in S3. This allow 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 dependency is `boto`.
## 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.
## Example
```python
from elefant import Elefant
# create Elefant object, passing in the Heroku app name
hb = Elefant("myapp", "muybucket")
print "Making and backup and uploading to S3..."
hb.backup()
print "Availiable backups:"
backups = hb.backups
for b in backups:
print b.name
print "Restoring from most recent backup..."
hb.restore(b)
print "Restoring from most recent backup using a string..."
hb.restore(b.name)
```
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
Elefant-0.0.5.tar.gz
(3.7 kB
view details)
File details
Details for the file Elefant-0.0.5.tar.gz
.
File metadata
- Download URL: Elefant-0.0.5.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b540ec1ecbb347d285e4d500956117cd879972070d7723b7b3f06ec09fd7e15 |
|
MD5 | b711b111df36b599cdcd0ea2223b99aa |
|
BLAKE2b-256 | e386a468824fe277522bf474ff2fbf010759fb283db22a172f30344e6f264c18 |