Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased¶
- Nothing (yet)!
5.0.1 - 2025-11-07¶
Security¶
- To prevent accidental media exports, this package will now generate an exception if utilizing the legacy
DBBACKUP_STORAGEorDBBACKUP_STORAGE_OPTIONSsettings. These settings have been removed in favor of using Django's built-inSTORAGESsetting. Please refer to the documentation for more information on how to migrate your configuration.
5.0.0 - 2025-08-30¶
Breaking Changes
This release contains several breaking changes. Prior to upgrading, follow this upgrade guide:
- Migrate Storage Settings: Remove
DBBACKUP_STORAGEandDBBACKUP_STORAGE_OPTIONSfrom your settings. Instead, configure your storage backend using Django'sSTORAGESsetting with the alias'dbbackup'. Refer to the Django documentation for guidance. - Update Admin Settings: Replace any usage of the deprecated
DBBACKUP_FAILURE_RECIPIENTSsetting withDBBACKUP_ADMINSto specify email recipients for failure notifications. - Review Connector Changes: The default SQLite connector has changed to
SqliteBackupConnectorto adhere to best practices. If you were previously using the default connector (SqliteConnector), either take this into account within your backup workflow or manually set the connector back toSqliteConnectorin your settings.
Added¶
- Implement new
SqliteBackupConnectorto backup SQLite3 databases using the.backupcommand (safe to execute on databases with active connections). - Verified full Windows compatibility via new CI workflows.
- Add Django Signals support for backup and restore operations. New signals include
pre_backup,post_backup,pre_restore,post_restore,pre_media_backup,post_media_backup,pre_media_restore, andpost_media_restore. - New
DjangoConnectorthat provides database-agnostic backup and restore functionality using Django's built-indumpdataandloaddatamanagement commands.
Changed¶
- This repository has been transferred out of Jazzband due to logistical concerns.
- Improve error message for missing database tools (
pg_dump,mysqldump, etc.) to provide guidance instead of generic "No such file or directory" errors. - Changed default SQLite connector from
SqliteConnectortoSqliteBackupConnectorto adhere to best practices. - Set default
IF_EXISTStoTruefor PostgreSQL connectors (PgDumpConnectorandPgDumpBinaryConnector) to reduce restore errors when objects are absent. - If
PASSWORDis set toNonefor PostgreSQL connectors, the--no-passwordflag is now automatically used.
Removed¶
- Drop support for end-of-life Python 3.7 and 3.8.
- Drop support for end-of-life Django 3.2.
- Drop
pytzdependency in favor of Python's standard libraryzoneinfo(following Django 4.0+ timezone implementation). - Drop support for
DBBACKUP_STORAGEANDDBBACKUP_STORAGE_OPTIONSsettings, use Django'sSTORAGES['dbbackup']setting instead. - Remove deprecated
DBBACKUP_FAILURE_RECIPIENTSsetting, useDBBACKUP_ADMINSinstead. - Remove deprecated code for legacy Django version compatibility.
Fixed¶
- Fixed
-Oflag to properly handle S3 URIs. Nowpython manage.py dbbackup -O s3://bucket/path/andpython manage.py mediabackup -O s3://bucket/path/correctly route S3 URIs to the storage backend instead of attempting to write to local filesystem. - Fix issues with parsing excess whitespace within
dbbackup -d "<COMMA_SEPARATED_ARGS>" - Fix encryption support when using
gnupg==5.x. - Resolve SQLite backup temporary file locking issues on Windows.
- Fix MediaRestore path corruption for files containing "media" in their paths.
- Fix FTP storage restore issue where file objects without
fileno()support causedio.UnsupportedOperationerror during database restore operations. - Fix SQLite restore failing when multi-line
TextFieldcontent contains semicolons. - Fix SQLite
no such tableerrors. - Fix SQLite
UNIQUE constrainterrors. - Fix SQLite
index/trigger/view<NAME> already existserrors. - Fix PostgreSQL restore errors with identity columns by automatically enabling
--if-existswhen using--cleaninPgDumpBinaryConnector.
Security¶
- Use environment variable for PostgreSQL password to prevent password leakage in logs/emails.
4.3.0 - 2025-05-09¶
Added¶
- Add generic
--pg-optionsto pass custom options to postgres. - Add option
--if-existsforpg_dumpcommand. - Support Python 3.13 and Django 5.2.
Fixed¶
- Empty string as HOST for postgres unix domain socket connection is now supported.
4.2.1 - 2024-08-23¶
Added¶
- Add
--no-dropoption todbrestorecommand to prevent dropping tables before restoring data.
Fixed¶
- Fix bug where sqlite
dbrestorewould fail if field data contains the line break character.
4.2.0 - 2024-08-22¶
Added¶
- Add PostgreSQL Schema support.
- Add support for new
STORAGES(Django 4.2+) setting under the 'dbbackup' alias.
Changed¶
- Set postgres default database
HOSTto"localhost". - Add warning for filenames with slashes in them.
Removed¶
- Remove usage of deprecated
get_storage_classfunction in newer Django versions.
Fixed¶
- Fix restore of database from S3 storage by reintroducing
inputfile.seek(0)toutils.uncompress_file. - Fix bug where dbbackup management commands would not respect
settings.py:DBBACKUP_DATABASES.
4.1.0 - 2024-01-14¶
Added¶
- Support Python 3.11 and 3.12.
- Support Django 4.1, 4.2, and 5.0.
Changed¶
- Update documentation for backup directory consistency and update links.
Removed¶
- Drop python 3.6.
Fixed¶
- Fix restore fail after editing filename.
RESTORE_PREFIXforRESTORE_SUFFIX.
4.0.2 - 2022-09-27¶
Added¶
- Support for prometheus wrapped databases.
Fixed¶
- Backup of SQLite fail if there are Virtual Tables (e.g. FTS tables).
- Fix broken
unencrypt_filefunction inpython-gnupg.
4.0.1 - 2022-07-09¶
Added¶
- Add authentication database support for MongoDB.
- Explicitly support Python 3.6+.
- Add support for exclude tables data in the command interface.
- Enable functional tests in CI.
Changed¶
- Replace
ugettext_lazywithgettext_lazy. - Changed logging settings from
settings.pyto late init. - Use
exclude-table-datainstead ofexclude-table. - Move author and version information into
setup.pyto allow building package in isolated environment (e.g. with thebuildpackage). - As of this version, dbbackup is now within Jazzband! This version tests our Jazzband release CI, and adds miscellaneous refactoring/cleanup.
- Update
settings.pycomment. - Jazzband transfer tasks.
- Refactoring and tooling.
Removed¶
- Remove six dependency.
- Drop support for end of life Django versions. Currently support 2.2, 3.2, 4.0.
Fixed¶
- Fix
RemovedInDjango41Warningrelated todefault_app_config. - Fix authentication error when postgres is password protected.
- Documentation fixes.
- Fix GitHub Actions configuration.
3.3.0 - 2020-04-14¶
Added¶
"output-filename"inmediabackupcommand.- Updates to include SFTP storage.
Fixed¶
- Fixes for test infrastructure and mongodb support.
- sqlite3: don't throw warnings if table already exists.
- Fixes for django v3 and update travis.
- Restoring from FTP.
- Fix management commands when using Postgres on non-latin Windows.
- Fix improper database name selection when performing a restore.
3.2.0 - 2017-09-18¶
Added¶
PgDumpBinaryConnector(binarypg_dumpintegration) with related functional tests.- Option to keep specific old backups (custom clean old backups logic).
Changed¶
- Updated PostgreSQL documentation and help text for clarity.
Fixed¶
- SFTP storage file attribute error ("SFTPStorageFile object has no attribute name").
- Escaping of passwords passed to commands.
- Corrected management command help text after flag logic change.
3.1.3 - 2016-11-25¶
Fixed¶
- Reverted a regression in
pg_dumpdatabase name handling introduced shortly before.
3.1.2 - 2016-11-25¶
Fixed¶
- Correct
pg_dumpinvocation: proper username and database argument handling.
3.1.1 - 2016-11-16¶
Fixed¶
- Unicode handling issues with SQLite backups.
3.1.0 - 2016-11-15¶
Added¶
- Support for inheriting parent environment variables in command connectors (
USE_PARENT_ENV).
Changed¶
- Complete revamp of logging and error email notification system (more structured logging & tests).
3.0.4 - 2016-11-14¶
Added¶
- Ability to link / register custom connectors.
Changed¶
- Use naïve (timezone-unaware)
datetimein backup filenames for broader compatibility.
Fixed¶
mediabackuptimeout issue.- Improved PostgreSQL
dbrestoreerror recognition.
3.0.3 - 2016-09-15¶
Added¶
- Server name filter for database and media backup/restore.
- Ability to select multiple databases for backup.
Changed¶
- Improved filename generation logic.
Fixed¶
- Database filter logic and clean backup behavior.
3.0.2 - 2016-08-06¶
Fixed¶
- Disabled Django loggers inadvertently affecting application logging.
3.0.1 - 2016-08-04¶
Added¶
- New connector architecture with dedicated connectors for PostgreSQL, MySQL, SQLite (copy) and MongoDB.
- Media backup & restore system overhaul (per-file processing, media restore command & tests).
- Exclude table/data options, prefix & suffix options for connector commands.
- Environment variable control for command execution.
- GIS database engine mapping support.
- Functional, integration and upgrade test suites; app & system checks integration.
Changed¶
- Refactored and unified code between database & media backup/restore commands.
- Renamed
mediabackupoption (--no-compressreplaced by explicit--compress).
Removed¶
- Legacy
DBCommandcode in favor of new connector system.
2.5.0 - 2016-03-29¶
Added¶
--filenameand--pathoptions fordbbackup/dbrestorecommands.- Binary size unit prefixes in output.
Changed¶
- Dropbox storage updated to OAuth2 & Python 3 compatibility.
Removed¶
DBBACKUP_DROPBOX_ACCESS_TYPEsetting (deprecated by OAuth2 changes).
Fixed¶
- NameError for missing
warningsimport. - Wildcard handling in generated filenames; proper server name derivation for SQLite paths.
2.3.3 - 2015-10-05¶
Changed¶
- Initial copy from BitBucket to GitHub.
Fixed¶
- Miscellaneous maintenance and minor bug fixes.