Django-DBBackup¶
This Django application provides management commands to help backup and restore your project
database to AmazonS3, Dropbox or Local Disk.
Quick Start: Backup to AmazonS3¶
- Install django-dbbackup and the required simples3 dependancy:
>> cd django-dbbackup >> python setup.py install >> pip install simples3
- Add 'dbbackup' to INSTALLED_APPS in your settings.py file.
- Include the required settings for Amazon S3.
DBBACKUP_STORAGE = 'dbbackup.storage.s3_storage' DBBACKUP_S3_BUCKET = '<amazon_bucket_name>' DBBACKUP_S3_ACCESS_KEY = '<amazon_access_key>' DBBACKUP_S3_SECRET_KEY = '<amazon_secret_key>'
- Now you're ready to use the managements commands below.
Management Commands¶
DBBackup
Backup your database to the specified storage. By default this will backup all databases specified in your settings.py file and will not delete any old backups. You can optionally specify a server name to be included in the backup filename.
dbbackup [-s <servername>] [-d <database>] [--clean]
DBRestore
Restore your database from the specified storage. By default this will lookup the latest backup and restore from that. You may optionally specify a servername if you you want to backup a database image that was created from a different server. You may also specify an explicit local file to backup from.
dbrestore [-d <database>] [-s <servername>] [-f <localfile>]
About This Project
Django-DBBackup is a project created by me (Michael Shepanski), a web developer located in Boston, MA. I developed this project out of a need to backup this personal site database to an offsite location. Feel free to manipulate, improve upon, and use however you'd like.
Licensed via Creative Commons Attribution.
More Documentation
- Intro & Management Commands
- Setup Backups to Amazon S3
- Setup Backups to Dropbox
- Setup Backups to Local Disk
- Customize Backup Commands
Database Compatability
My testing resulted the following. If you find different, please let me know and I will adjust.
- SQLite 3.x
- MySQL 5.x
- PostgreSQL 9.x
Support & Contact
- Fork me from the Bitbucket repository.
- Join discussions in the Google Group.
- Report issues and bugs here.
- Follow @PKKid on Twitter for release updates and news.