| 1 |
# Changelog |
| 2 |
|
| 3 |
All notable changes to this project will be documented in this file. |
| 4 |
|
| 5 |
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 6 |
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 |
|
| 8 |
<!-- |
| 9 |
Using the following categories, list your changes in this order: |
| 10 |
[Added, Changed, Deprecated, Removed, Fixed, Security] |
| 11 |
|
| 12 |
Don't forget to remove deprecated code on each major release! |
| 13 |
--> |
| 14 |
|
| 15 |
## [Unreleased] |
| 16 |
|
| 17 |
- Nothing (yet)! |
| 18 |
|
| 19 |
## [5.3.1] - 2026-09-10 |
| 20 |
|
| 21 |
### Changed |
| 22 |
|
| 23 |
- PostgreSQL `HOST` that are Unix/Windows socket paths will now be automatically URI-encoded to uphold `pg_restore` command line requirements. |
| 24 |
|
| 25 |
### Fixed |
| 26 |
|
| 27 |
- `--verbosity` parameter now correctly outputs log messages to the console instead of suppressing all output regardless of verbosity level. |
| 28 |
|
| 29 |
## [5.3.0] - 2026-04-09 |
| 30 |
|
| 31 |
### Fixed |
| 32 |
|
| 33 |
- Fix compression when using `DjangoConnector`. |
| 34 |
- Fix an issue with paramiko `os.stat` sizes were larger on the target compared to the source. |
| 35 |
- Fix issue with `dbrestore` not finding backups when `location` is set in storage options. |
| 36 |
|
| 37 |
## [5.2.0] - 2026-02-10 |
| 38 |
|
| 39 |
### Added |
| 40 |
|
| 41 |
- Added support for custom metadata writing and validation during operations via `DBBACKUP_BACKUP_METADATA_SETTER` and `DBBACKUP_RESTORE_METADATA_VALIDATOR` settings. |
| 42 |
|
| 43 |
## [5.1.2] - 2026-01-14 |
| 44 |
|
| 45 |
### Fixed |
| 46 |
|
| 47 |
- Fixed a bug where metadata files were not being removed during clean-up. |
| 48 |
|
| 49 |
## [5.1.1] - 2026-01-07 |
| 50 |
|
| 51 |
### Fixed |
| 52 |
|
| 53 |
- Ensure `dbbackup` metadata file is always written as bytes to support storage backends that enforce bytes content (e.g. Google Cloud Storage). |
| 54 |
|
| 55 |
## [5.1.0] - 2025-12-17 |
| 56 |
|
| 57 |
### Fixed |
| 58 |
|
| 59 |
- 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. |
| 60 |
- Fixed compressed media backup restoration by using `gzip.GzipFile` instead of `tarfile`'s gzip decompression algorithm. |
| 61 |
|
| 62 |
## [5.0.1] - 2025-11-07 |
| 63 |
|
| 64 |
### Security |
| 65 |
|
| 66 |
- To prevent accidental media exports, this package will now generate an exception if utilizing the legacy `DBBACKUP_STORAGE` or `DBBACKUP_STORAGE_OPTIONS` settings. These settings have been removed in favor of using Django's built-in `STORAGES` setting. Please refer to the documentation for more information on how to migrate your configuration. |
| 67 |
|
| 68 |
## [5.0.0] - 2025-08-30 |
| 69 |
|
| 70 |
!!! warning "Breaking Changes" |
| 71 |
|
| 72 |
This release contains several breaking changes. Prior to upgrading, follow this upgrade guide: |
| 73 |
|
| 74 |
1. **Migrate Storage Settings**: Remove `DBBACKUP_STORAGE` and `DBBACKUP_STORAGE_OPTIONS` from your settings. Instead, configure your storage backend using Django's `STORAGES` setting with the alias `'dbbackup'`. Refer to the [Django documentation](https://docs.djangoproject.com/en/stable/ref/settings/#storages) for guidance. |
| 75 |
2. **Update Admin Settings**: Replace any usage of the deprecated `DBBACKUP_FAILURE_RECIPIENTS` setting with `DBBACKUP_ADMINS` to specify email recipients for failure notifications. |
| 76 |
3. **Review Connector Changes**: The default SQLite connector has changed to `SqliteBackupConnector` to 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 to `SqliteConnector` in your settings. |
| 77 |
|
| 78 |
### Added |
| 79 |
|
| 80 |
- Implement new `SqliteBackupConnector` to backup SQLite3 databases using the `.backup` command (safe to execute on databases with active connections). |
| 81 |
- Verified full Windows compatibility via new CI workflows. |
| 82 |
- 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`, and `post_media_restore`. |
| 83 |
- New `DjangoConnector` that provides database-agnostic backup and restore functionality using Django's built-in `dumpdata` and `loaddata` management commands. |
| 84 |
|
| 85 |
### Changed |
| 86 |
|
| 87 |
- This repository has been transferred out of Jazzband due to logistical concerns. |
| 88 |
- Improve error message for missing database tools (`pg_dump`, `mysqldump`, etc.) to provide guidance instead of generic "No such file or directory" errors. |
| 89 |
- Changed default SQLite connector from `SqliteConnector` to `SqliteBackupConnector` to adhere to best practices. |
| 90 |
- Set default `IF_EXISTS` to `True` for PostgreSQL connectors (`PgDumpConnector` and `PgDumpBinaryConnector`) to reduce restore errors when objects are absent. |
| 91 |
- If `PASSWORD` is set to `None` for PostgreSQL connectors, the `--no-password` flag is now automatically used. |
| 92 |
|
| 93 |
### Removed |
| 94 |
|
| 95 |
- Drop support for end-of-life Python 3.7 and 3.8. |
| 96 |
- Drop support for end-of-life Django 3.2. |
| 97 |
- Drop `pytz` dependency in favor of Python's standard library `zoneinfo` (following Django 4.0+ timezone implementation). |
| 98 |
- Drop support for `DBBACKUP_STORAGE` AND `DBBACKUP_STORAGE_OPTIONS` settings, use Django's `STORAGES['dbbackup']` setting instead. |
| 99 |
- Remove deprecated `DBBACKUP_FAILURE_RECIPIENTS` setting, use `DBBACKUP_ADMINS` instead. |
| 100 |
- Remove deprecated code for legacy Django version compatibility. |
| 101 |
|
| 102 |
### Fixed |
| 103 |
|
| 104 |
- Fixed `-O` flag to properly handle S3 URIs. Now `python manage.py dbbackup -O s3://bucket/path/` and `python manage.py mediabackup -O s3://bucket/path/` correctly route S3 URIs to the storage backend instead of attempting to write to local filesystem. |
| 105 |
- Fix issues with parsing excess whitespace within `dbbackup -d "<COMMA_SEPARATED_ARGS>"` |
| 106 |
- Fix encryption support when using `gnupg==5.x`. |
| 107 |
- Resolve SQLite backup temporary file locking issues on Windows. |
| 108 |
- Fix MediaRestore path corruption for files containing "media" in their paths. |
| 109 |
- Fix FTP storage restore issue where file objects without `fileno()` support caused `io.UnsupportedOperation` error during database restore operations. |
| 110 |
- Fix SQLite restore failing when multi-line `TextField` content contains semicolons. |
| 111 |
- Fix SQLite `no such table` errors. |
| 112 |
- Fix SQLite `UNIQUE constraint` errors. |
| 113 |
- Fix SQLite `index`/`trigger`/`view` `<NAME> already exists` errors. |
| 114 |
- Fix PostgreSQL restore errors with identity columns by automatically enabling `--if-exists` when using `--clean` in `PgDumpBinaryConnector`. |
| 115 |
|
| 116 |
### Security |
| 117 |
|
| 118 |
- Use environment variable for PostgreSQL password to prevent password leakage in logs/emails. |
| 119 |
|
| 120 |
## [4.3.0] - 2025-05-09 |
| 121 |
|
| 122 |
### Added |
| 123 |
|
| 124 |
- Add generic `--pg-options` to pass custom options to postgres. |
| 125 |
- Add option `--if-exists` for `pg_dump` command. |
| 126 |
- Support Python 3.13 and Django 5.2. |
| 127 |
|
| 128 |
### Fixed |
| 129 |
|
| 130 |
- Empty string as HOST for postgres unix domain socket connection is now supported. |
| 131 |
|
| 132 |
## [4.2.1] - 2024-08-23 |
| 133 |
|
| 134 |
### Added |
| 135 |
|
| 136 |
- Add `--no-drop` option to `dbrestore` command to prevent dropping tables before restoring data. |
| 137 |
|
| 138 |
### Fixed |
| 139 |
|
| 140 |
- Fix bug where sqlite `dbrestore` would fail if field data contains the line break character. |
| 141 |
|
| 142 |
## [4.2.0] - 2024-08-22 |
| 143 |
|
| 144 |
### Added |
| 145 |
|
| 146 |
- Add PostgreSQL Schema support. |
| 147 |
- Add support for new `STORAGES` (Django 4.2+) setting under the 'dbbackup' alias. |
| 148 |
|
| 149 |
### Changed |
| 150 |
|
| 151 |
- Set postgres default database `HOST` to `"localhost"`. |
| 152 |
- Add warning for filenames with slashes in them. |
| 153 |
|
| 154 |
### Removed |
| 155 |
|
| 156 |
- Remove usage of deprecated `get_storage_class` function in newer Django versions. |
| 157 |
|
| 158 |
### Fixed |
| 159 |
|
| 160 |
- Fix restore of database from S3 storage by reintroducing `inputfile.seek(0)` to `utils.uncompress_file`. |
| 161 |
- Fix bug where dbbackup management commands would not respect `settings.py:DBBACKUP_DATABASES`. |
| 162 |
|
| 163 |
## [4.1.0] - 2024-01-14 |
| 164 |
|
| 165 |
### Added |
| 166 |
|
| 167 |
- Support Python 3.11 and 3.12. |
| 168 |
- Support Django 4.1, 4.2, and 5.0. |
| 169 |
|
| 170 |
### Changed |
| 171 |
|
| 172 |
- Update documentation for backup directory consistency and update links. |
| 173 |
|
| 174 |
### Removed |
| 175 |
|
| 176 |
- Drop python 3.6. |
| 177 |
|
| 178 |
### Fixed |
| 179 |
|
| 180 |
- Fix restore fail after editing filename. |
| 181 |
- `RESTORE_PREFIX` for `RESTORE_SUFFIX`. |
| 182 |
|
| 183 |
## [4.0.2] - 2022-09-27 |
| 184 |
|
| 185 |
### Added |
| 186 |
|
| 187 |
- Support for prometheus wrapped databases. |
| 188 |
|
| 189 |
### Fixed |
| 190 |
|
| 191 |
- Backup of SQLite fail if there are Virtual Tables (e.g. FTS tables). |
| 192 |
- Fix broken `unencrypt_file` function in `python-gnupg`. |
| 193 |
|
| 194 |
## [4.0.1] - 2022-07-09 |
| 195 |
|
| 196 |
### Added |
| 197 |
|
| 198 |
- Add authentication database support for MongoDB. |
| 199 |
- Explicitly support Python 3.6+. |
| 200 |
- Add support for exclude tables data in the command interface. |
| 201 |
- Enable functional tests in CI. |
| 202 |
|
| 203 |
### Changed |
| 204 |
|
| 205 |
- Replace `ugettext_lazy` with `gettext_lazy`. |
| 206 |
- Changed logging settings from `settings.py` to late init. |
| 207 |
- Use `exclude-table-data` instead of `exclude-table`. |
| 208 |
- Move author and version information into `setup.py` to allow building package in isolated environment (e.g. with the `build` package). |
| 209 |
- As of this version, dbbackup is now within Jazzband! This version tests our Jazzband release CI, and adds miscellaneous refactoring/cleanup. |
| 210 |
- Update `settings.py` comment. |
| 211 |
- Jazzband transfer tasks. |
| 212 |
- Refactoring and tooling. |
| 213 |
|
| 214 |
### Removed |
| 215 |
|
| 216 |
- Remove six dependency. |
| 217 |
- Drop support for end of life Django versions. Currently support 2.2, 3.2, 4.0. |
| 218 |
|
| 219 |
### Fixed |
| 220 |
|
| 221 |
- Fix `RemovedInDjango41Warning` related to `default_app_config`. |
| 222 |
- Fix authentication error when postgres is password protected. |
| 223 |
- Documentation fixes. |
| 224 |
- Fix GitHub Actions configuration. |
| 225 |
|
| 226 |
## [3.3.0] - 2020-04-14 |
| 227 |
|
| 228 |
### Added |
| 229 |
|
| 230 |
- `"output-filename"` in `mediabackup` command. |
| 231 |
- Updates to include SFTP storage. |
| 232 |
|
| 233 |
### Fixed |
| 234 |
|
| 235 |
- Fixes for test infrastructure and mongodb support. |
| 236 |
- sqlite3: don't throw warnings if table already exists. |
| 237 |
- Fixes for django v3 and update travis. |
| 238 |
- Restoring from FTP. |
| 239 |
- Fix management commands when using Postgres on non-latin Windows. |
| 240 |
- Fix improper database name selection when performing a restore. |
| 241 |
|
| 242 |
## [3.2.0] - 2017-09-18 |
| 243 |
|
| 244 |
### Added |
| 245 |
|
| 246 |
- `PgDumpBinaryConnector` (binary `pg_dump` integration) with related functional tests. |
| 247 |
- Option to keep specific old backups (custom clean old backups logic). |
| 248 |
|
| 249 |
### Changed |
| 250 |
|
| 251 |
- Updated PostgreSQL documentation and help text for clarity. |
| 252 |
|
| 253 |
### Fixed |
| 254 |
|
| 255 |
- SFTP storage file attribute error ("SFTPStorageFile object has no attribute name"). |
| 256 |
- Escaping of passwords passed to commands. |
| 257 |
- Corrected management command help text after flag logic change. |
| 258 |
|
| 259 |
## [3.1.3] - 2016-11-25 |
| 260 |
|
| 261 |
### Fixed |
| 262 |
|
| 263 |
- Reverted a regression in `pg_dump` database name handling introduced shortly before. |
| 264 |
|
| 265 |
## [3.1.2] - 2016-11-25 |
| 266 |
|
| 267 |
### Fixed |
| 268 |
|
| 269 |
- Correct `pg_dump` invocation: proper username and database argument handling. |
| 270 |
|
| 271 |
## [3.1.1] - 2016-11-16 |
| 272 |
|
| 273 |
### Fixed |
| 274 |
|
| 275 |
- Unicode handling issues with SQLite backups. |
| 276 |
|
| 277 |
## [3.1.0] - 2016-11-15 |
| 278 |
|
| 279 |
### Added |
| 280 |
|
| 281 |
- Support for inheriting parent environment variables in command connectors (`USE_PARENT_ENV`). |
| 282 |
|
| 283 |
### Changed |
| 284 |
|
| 285 |
- Complete revamp of logging and error email notification system (more structured logging & tests). |
| 286 |
|
| 287 |
## [3.0.4] - 2016-11-14 |
| 288 |
|
| 289 |
### Added |
| 290 |
|
| 291 |
- Ability to link / register custom connectors. |
| 292 |
|
| 293 |
### Changed |
| 294 |
|
| 295 |
- Use naïve (timezone-unaware) `datetime` in backup filenames for broader compatibility. |
| 296 |
|
| 297 |
### Fixed |
| 298 |
|
| 299 |
- `mediabackup` timeout issue. |
| 300 |
- Improved PostgreSQL `dbrestore` error recognition. |
| 301 |
|
| 302 |
## [3.0.3] - 2016-09-15 |
| 303 |
|
| 304 |
### Added |
| 305 |
|
| 306 |
- Server name filter for database and media backup/restore. |
| 307 |
- Ability to select multiple databases for backup. |
| 308 |
|
| 309 |
### Changed |
| 310 |
|
| 311 |
- Improved filename generation logic. |
| 312 |
|
| 313 |
### Fixed |
| 314 |
|
| 315 |
- Database filter logic and clean backup behavior. |
| 316 |
|
| 317 |
## [3.0.2] - 2016-08-06 |
| 318 |
|
| 319 |
### Fixed |
| 320 |
|
| 321 |
- Disabled Django loggers inadvertently affecting application logging. |
| 322 |
|
| 323 |
## [3.0.1] - 2016-08-04 |
| 324 |
|
| 325 |
### Added |
| 326 |
|
| 327 |
- New connector architecture with dedicated connectors for PostgreSQL, MySQL, SQLite (copy) and MongoDB. |
| 328 |
- Media backup & restore system overhaul (per-file processing, media restore command & tests). |
| 329 |
- Exclude table/data options, prefix & suffix options for connector commands. |
| 330 |
- Environment variable control for command execution. |
| 331 |
- GIS database engine mapping support. |
| 332 |
- Functional, integration and upgrade test suites; app & system checks integration. |
| 333 |
|
| 334 |
### Changed |
| 335 |
|
| 336 |
- Refactored and unified code between database & media backup/restore commands. |
| 337 |
- Renamed `mediabackup` option (`--no-compress` replaced by explicit `--compress`). |
| 338 |
|
| 339 |
### Removed |
| 340 |
|
| 341 |
- Legacy `DBCommand` code in favor of new connector system. |
| 342 |
|
| 343 |
## [2.5.0] - 2016-03-29 |
| 344 |
|
| 345 |
### Added |
| 346 |
|
| 347 |
- `--filename` and `--path` options for `dbbackup` / `dbrestore` commands. |
| 348 |
- Binary size unit prefixes in output. |
| 349 |
|
| 350 |
### Changed |
| 351 |
|
| 352 |
- Dropbox storage updated to OAuth2 & Python 3 compatibility. |
| 353 |
|
| 354 |
### Removed |
| 355 |
|
| 356 |
- `DBBACKUP_DROPBOX_ACCESS_TYPE` setting (deprecated by OAuth2 changes). |
| 357 |
|
| 358 |
### Fixed |
| 359 |
|
| 360 |
- NameError for missing `warnings` import. |
| 361 |
- Wildcard handling in generated filenames; proper server name derivation for SQLite paths. |
| 362 |
|
| 363 |
## [2.3.3] - 2015-10-05 |
| 364 |
|
| 365 |
### Changed |
| 366 |
|
| 367 |
- Initial copy from BitBucket to GitHub. |
| 368 |
|
| 369 |
### Fixed |
| 370 |
|
| 371 |
- Miscellaneous maintenance and minor bug fixes. |
| 372 |
|
| 373 |
[Unreleased]: https://github.com/Archmonger/django-dbbackup/compare/5.3.1...HEAD |
| 374 |
[5.3.1]: https://github.com/Archmonger/django-dbbackup/compare/5.3.0...5.3.1 |
| 375 |
[5.3.0]: https://github.com/Archmonger/django-dbbackup/compare/5.2.0...5.3.0 |
| 376 |
[5.2.0]: https://github.com/Archmonger/django-dbbackup/compare/5.1.2...5.2.0 |
| 377 |
[5.1.2]: https://github.com/Archmonger/django-dbbackup/compare/5.1.1...5.1.2 |
| 378 |
[5.1.1]: https://github.com/Archmonger/django-dbbackup/compare/5.1.0...5.1.1 |
| 379 |
[5.1.0]: https://github.com/Archmonger/django-dbbackup/compare/5.0.1...5.1.0 |
| 380 |
[5.0.1]: https://github.com/Archmonger/django-dbbackup/compare/5.0.0...5.0.1 |
| 381 |
[5.0.0]: https://github.com/Archmonger/django-dbbackup/compare/4.3.0...5.0.0 |
| 382 |
[4.3.0]: https://github.com/Archmonger/django-dbbackup/compare/4.2.1...4.3.0 |
| 383 |
[4.2.1]: https://github.com/Archmonger/django-dbbackup/compare/4.2.0...4.2.1 |
| 384 |
[4.2.0]: https://github.com/Archmonger/django-dbbackup/compare/4.1.0...4.2.0 |
| 385 |
[4.1.0]: https://github.com/Archmonger/django-dbbackup/compare/4.0.2...4.1.0 |
| 386 |
[4.0.2]: https://github.com/Archmonger/django-dbbackup/compare/4.0.1...4.0.2 |
| 387 |
[4.0.1]: https://github.com/Archmonger/django-dbbackup/compare/3.3.0...4.0.1 |
| 388 |
[3.3.0]: https://github.com/Archmonger/django-dbbackup/compare/3.2.0...3.3.0 |
| 389 |
[3.2.0]: https://github.com/Archmonger/django-dbbackup/compare/3.1.3...3.2.0 |
| 390 |
[3.1.3]: https://github.com/Archmonger/django-dbbackup/compare/3.1.2...3.1.3 |
| 391 |
[3.1.2]: https://github.com/Archmonger/django-dbbackup/compare/3.1.1...3.1.2 |
| 392 |
[3.1.1]: https://github.com/Archmonger/django-dbbackup/compare/3.1.0...3.1.1 |
| 393 |
[3.1.0]: https://github.com/Archmonger/django-dbbackup/compare/3.0.4...3.1.0 |
| 394 |
[3.0.4]: https://github.com/Archmonger/django-dbbackup/compare/3.0.3...3.0.4 |
| 395 |
[3.0.3]: https://github.com/Archmonger/django-dbbackup/compare/3.0.2...3.0.3 |
| 396 |
[3.0.2]: https://github.com/Archmonger/django-dbbackup/compare/3.0.1...3.0.2 |
| 397 |
[3.0.1]: https://github.com/Archmonger/django-dbbackup/compare/2.5.0...3.0.1 |
| 398 |
[2.5.0]: https://github.com/Archmonger/django-dbbackup/compare/2.3.3...2.5.0 |
| 399 |
[2.3.3]: https://github.com/Archmonger/django-dbbackup/releases/tag/2.3.3 |