Registry / database / django-dbbackup

django-dbbackup

JSON →
library5.3.0pypypiunverified

Django DBBackup is an active and frequently updated (multiple minor releases per quarter) Django application that provides management commands to simplify backing up and restoring project databases and media files. It supports various storage backends like local filesystem, Amazon S3, Dropbox, and any Django-supported storage, offering features such as GPG encryption, compression, remote archiving, and the ability to set up automated backups via Crontab or Celery.

pip install django-dbbackup
INSTALL
IMPORT
SIG · DJANGO-DBBACKUP
D
django-dbbackup
databasepythonv5.3.0
Install
3.4s avg
Import
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 66.6MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.4s · import 0.000s · 67MB
66MB installed
● package 66MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dbbackup
Django management commands are run via `python manage.py dbbackup`
import dbbackup; dbbackup.some_function()
django-dbbackup is primarily designed to be interacted with via Django management commands (e.g., `dbbackup`, `dbrestore`, `mediabackup`), not direct Python imports for command execution. Direct imports are typically only for extending functionality like custom connectors or signal receivers.

1. Add 'dbbackup' to your `INSTALLED_APPS` in `settings.py`. 2. Configure a `STORAGES['dbbackup']` entry to define where your backups will be stored. It's recommended to use a dedicated directory, not your `MEDIA_ROOT`, to avoid accidental public exposure. 3. Run `python manage.py dbbackup` to create a database backup and `python manage.py mediabackup` for media files. Use `dbrestore` and `mediarestore` to restore.

import os from pathlib import Path # settings.py BASE_DIR = Path(__file__).resolve().parent.parent INSTALLED_APPS = [ # ... other apps 'dbbackup', ] # Configure a storage backend for backups # Using FileSystemStorage for local backups DB_BACKUP_LOCATION = os.path.join(BASE_DIR, 'my_backups') os.makedirs(DB_BACKUP_LOCATION, exist_ok=True) STORAGES = { "dbbackup": { "BACKEND": "django.core.files.storage.FileSystemStorage", "OPTIONS": { "location": DB_BACKUP_LOCATION, }, }, } # Example of running commands (from your project root) # Make a backup: # python manage.py dbbackup --noinput # python manage.py mediabackup --noinput # Restore latest backup: # python manage.py dbrestore --noinput # python manage.py mediarestore --noinput
python manage.py dbbackup --version
Debug
Known issues
breakingThe legacy settings `DBBACKUP_STORAGE` and `DBBACKUP_STORAGE_OPTIONS` were removed in version 5.0.1.
fix
Migrate your storage configuration to use Django's standard `STORAGES` setting under the 'dbbackup' key. Refer to the official documentation's 'Storage' section for examples.
affects: >=5.0.1
gotchaBy default, `dbrestore` prevents restoring a backup created for one database engine (e.g., PostgreSQL) to a different engine (e.g., SQLite) by checking metadata.
fix
Always restore backups to a database using the same engine they were created from. If you need to migrate between database types, use Django's `dumpdata` and `loaddata` commands.
affects: >=5.1.0
gotchaThe `dbbackup` command relies on external database utilities like `pg_dump` (PostgreSQL) or `mysqldump` (MySQL) being available in the system's PATH where the command is executed.
fix
Ensure the necessary database client tools (e.g., `postgresql-client` for `pg_dump`) are installed and their executables are accessible in the PATH of the environment running `manage.py dbbackup`. In Docker, this often means installing them in the same container as your Django app or executing the backup from the database container itself.
affects: All versions
gotchaConfiguring backup storage with the same configuration as your media files (e.g., `DEFAULT_FILE_STORAGE`) can risk exposing sensitive backups in public directories.
fix
Always configure `STORAGES['dbbackup']` with a dedicated and distinct storage location, preferably with restricted permissions, separate from your `MEDIA_ROOT`.
affects: All versions
Upgrade
Version history
5.3.0latest on PyPI · released Apr 10, 2026
Audit
Dependencies
DjangorequiredCore framework dependency, requires Django 3.2+
python-gnupgoptionalRequired for GPG encryption and decryption features.
django-storagesoptionalRequired for cloud storage backends like S3, Google Cloud Storage, Dropbox, etc.
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
2
Resources
django-dbbackup — pip install django-dbbackup · libregistry