/django-dbbackup

Management commands to help backup and restore your project database and media files

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Django Database Backup

Documentation Status https://coveralls.io/repos/django-dbbackup/django-dbbackup/badge.svg?branch=master&service=github

This Django application provides management commands to help backup and restore your project database and media files with various storages such as Amazon S3, DropBox or local file storage.

It is made for:

  • Ensure yours backup with GPG signature and encryption
  • Archive with compression
  • Use Crontab or Celery to setup automated backups.
  • Great to keep your development database up to date.

Docs

See our offical documentation at Read The Docs.

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] [--compress] [--encrypt] [--backup-extension <file-extension>]

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>] [--uncompress] [--backup-extension <file-extension>]

mediabackup

Backup media files. Default this will backup the files in the MEDIA_ROOT. Optionally you can set the DBBACKUP_MEDIA_PATH setting.

mediabackup [--encrypt] [--clean] [--servername <servername>]

Contributing

All contribution are very welcomed, propositions, problems, bugs and enhancement are tracked with GitHub issues system and patch are submitted via pull requests.

We use Travis coupled with Coveralls as continious integration tools.

https://ga-beacon.appspot.com/UA-87461-7/django-dbbackup/home

Tests

Tests are stored in :mod:`dbbackup.tests` and for run them you must launch:

python runtests.py

In fact, runtests.py acts as a manage.py file and all Django command are available. So you could launch:

python runtests.py shell

For get a Python shell configured with the test project. Also all test command options are available and usable for run only some chosen tests. See Django test command documentation for more informations about it.

To run the tests across all supported versions of Django and Python, you can use Tox. First install Tox:

pip install tox

To run the tests just use the command tox in the command line. If you want to run the tests against just one specific test environment you can run tox -e <testenv>. For example, to run the tests with Python3.3 and Django1.7 you would run:

tox -e py3.3-django1.9

The available test environments can be found in tox.ini.