Releases: Archmonger/django-dbbackup
Releases · Archmonger/django-dbbackup
5.3.0
5.2.0
Added
- Added support for custom metadata writing and validation during operations via
DBBACKUP_BACKUP_METADATA_SETTERandDBBACKUP_RESTORE_METADATA_VALIDATORsettings.
5.1.2
Fixed
- Fixed a bug where metadata files were not being removed during clean-up.
5.1.1
Fixed
- Ensure
dbbackupmetadata file is always written as bytes to support storage backends that enforce bytes content (e.g. Google Cloud Storage).
5.1.0
Fixed
- Prevent restoring a backup from a different database connector (e.g. Postgres backup to SQLite) by adding an additional metadata file to all new backups.
- Fixed compressed media backup restoration by using
gzip.GzipFileinstead oftarfile's gzip decompression algorithm.
5.0.1
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
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
- Add generic
--pg-optionsto pass custom options to postgres. - Add option
--if-existsfor pg_dump command - Empty string as HOST for postgres unix domain socket connection is now supported.
- Support Python 3.13 and Django 5.2
4.2.1
- Add --no-drop option to dbrestore command to prevent dropping tables before restoring data.
- Fix bug where sqlite dbrestore would fail if field data contains the line break character.
4.2.0
- Default HOST to localhost for postgres databases.
- Add PostgreSQL Schema support
- Fix restore of database from S3 storage by reintroducing inputfile.seek(0) to utils.uncompress_file
- Add warning for filenames with slashes in them
- Fix bug where dbbackup management command would not respect settings.py:DBBACKUP_DATABASES
- Remove usage of deprecated 'get_storage_class' function in newer Django versions
- Add support for new STORAGES (Django 4.2+) setting under the 'dbbackup' alias