Skip to content

Commit a51a707

Browse files
authored
5.3.0 (#669)
1 parent 06f2f59 commit a51a707

10 files changed

Lines changed: 158 additions & 130 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Don't forget to remove deprecated code on each major release!
1414

1515
## [Unreleased]
1616

17+
- Nothing (yet)!
18+
19+
## [5.3.0] - 2026-04-09
20+
1721
### Fixed
1822

1923
- Fix compression when using `DjangoConnector`.
@@ -356,7 +360,8 @@ Don't forget to remove deprecated code on each major release!
356360

357361
- Miscellaneous maintenance and minor bug fixes.
358362

359-
[Unreleased]: https://github.com/Archmonger/django-dbbackup/compare/5.2.0...HEAD
363+
[Unreleased]: https://github.com/Archmonger/django-dbbackup/compare/5.3.0...HEAD
364+
[5.3.0]: https://github.com/Archmonger/django-dbbackup/compare/5.2.0...5.3.0
360365
[5.2.0]: https://github.com/Archmonger/django-dbbackup/compare/5.1.2...5.2.0
361366
[5.1.2]: https://github.com/Archmonger/django-dbbackup/compare/5.1.1...5.1.2
362367
[5.1.1]: https://github.com/Archmonger/django-dbbackup/compare/5.1.0...5.1.1

dbbackup/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Management commands to help backup and restore a project database and media"""
22

3-
__version__ = "5.2.0"
3+
__version__ = "5.3.0"

docs/src/commands.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ restore the most recent matching backup.
88

99
Use `python manage.py <command> --help` for full option details.
1010

11+
---
12+
1113
## dbbackup
1214

1315
Create a database backup (optionally compressed/encrypted) and upload it.
1416

1517
```bash
16-
$ ./manage.py dbbackup
18+
$ python manage.py dbbackup
1719
Backing Up Database: tmp.x0kN9sYSqk
1820
Backup size: 3.3 KiB
1921
Writing file to tmp-zuluvm-2016-07-29-100954.dump
@@ -30,7 +32,7 @@ python manage.py dbbackup --help
3032
Download the latest database backup (or a specified one) then restore it.
3133

3234
```bash
33-
$ ./manage.py dbrestore
35+
$ python manage.py dbrestore
3436
Restoring backup for database: tmp.x0kN9sYSqk
3537
Finding latest backup
3638
Restoring: tmp-zuluvm-2016-07-29-100954.dump
@@ -49,7 +51,7 @@ Create an archive (tar) of media files, optionally compress/encrypt, and upload
4951
it to backup storage.
5052

5153
```bash
52-
$ ./manage.py mediabackup
54+
$ python manage.py mediabackup
5355
Backup size: 10.0 KiB
5456
Writing file to zuluvm-2016-07-04-081612.tar
5557
```
@@ -65,7 +67,7 @@ python manage.py mediabackup --help
6567
Restore media files: extract files from the archive and put them into media storage.
6668

6769
```bash
68-
$ ./manage.py mediarestore
70+
$ python manage.py mediarestore
6971
Restoring backup for media files
7072
Finding latest backup
7173
Reading file zuluvm-2016-07-04-082551.tar

docs/src/configuration.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Configuration
22

3-
## General settings
3+
---
4+
5+
## General
46

57
### DBBACKUP_DATABASES
68

@@ -102,7 +104,9 @@ default this is `settings.MEDIA_ROOT`.
102104

103105
Default: `settings.MEDIA_ROOT`
104106

105-
## Encrypting your backups
107+
---
108+
109+
## Encryption
106110

107111
Backups may contain personal or otherwise sensitive data. When storing them
108112
outside trusted infrastructure you should encrypt them. Keep your private
@@ -164,7 +168,9 @@ connector mapping.
164168

165169
Default: `{}`
166170

167-
## Email configuration
171+
---
172+
173+
## Email
168174

169175
### DBBACKUP_SEND_EMAIL
170176

@@ -194,18 +200,9 @@ Subject-line prefix for email messages sent by DBBackup.
194200

195201
Default: `'[dbbackup] '`
196202

197-
## Database configuration
198-
199-
By default DBBackup uses values from `settings.DATABASES`. Use
200-
`DBBACKUP_CONNECTORS` (documented above) for backup specific overrides. See
201-
[Database settings](databases.md) for backend specific options.
202-
203-
## Storage configuration
204-
205-
You must configure a storage backend (`STORAGES['dbbackup']`) to persist
206-
backups. See [Storage settings](storage.md) for supported options.
203+
---
207204

208-
## Custom metadata
205+
## Metadata
209206

210207
### DBBACKUP_BACKUP_METADATA_SETTER
211208

@@ -254,3 +251,18 @@ def validate_restore(metadata):
254251

255252
DBBACKUP_RESTORE_METADATA_VALIDATOR = validate_restore
256253
```
254+
255+
---
256+
257+
## Database
258+
259+
By default DBBackup uses values from `settings.DATABASES`. Use
260+
`DBBACKUP_CONNECTORS` (documented above) for backup specific overrides. See
261+
[Database settings](databases.md) for backend specific options.
262+
263+
---
264+
265+
## Storage
266+
267+
You must configure a storage backend (`STORAGES['dbbackup']`) to persist
268+
backups. See [Storage settings](storage.md) for supported options.

docs/src/databases.md

Lines changed: 63 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ The following databases are supported by this application:
88
- MongoDB
99
- ... and any other Django-supported database (via `DjangoConnector`)
1010

11+
DBBackup uses “connector” classes to implement backend specific dump and
12+
restore logic. Each connector may expose additional settings documented
13+
below.
14+
15+
---
16+
17+
## Settings Overrides
18+
1119
By default DBBackup reuses connection details from `settings.DATABASES`.
1220
Sometimes you want different credentials or a different host (e.g. read-only
1321
replica) just for backups. Use `DBBACKUP_CONNECTORS` for that purpose; it
@@ -26,9 +34,7 @@ DBBACKUP_CONNECTORS = {
2634
This configuration will allow you to use a replica with a different host and user,
2735
which is a great practice if you don't want to overload your main database.
2836

29-
DBBackup uses “connector” classes to implement backend specific dump and
30-
restore logic. Each connector may expose additional settings documented
31-
below.
37+
---
3238

3339
## Common Settings
3440

@@ -50,8 +56,7 @@ DBBACKUP_CONNECTORS = {
5056
}
5157
```
5258

53-
Some connectors use a command line tool as a dump engine, `mysqldump` for
54-
example. These kinds of tools have common attributes:
59+
Additionally, some connectors within this repository use a command line tool as a dump engine, (`MysqlDumpConnector` for example). These kinds of connectors have additional common attributes:
5560

5661
| Setting | Description | Default |
5762
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
@@ -73,12 +78,20 @@ DBBACKUP_CONNECTORS = {
7378
}
7479
```
7580

76-
## Built-in Database Connectors
81+
---
82+
83+
## Database Connectors
7784

7885
These connectors are provided by default and are designed to work with specific database engines. They provide optimized backup and restore functionality.
7986

8087
### SQLite
8188

89+
#### Settings
90+
91+
SQLite connectors do not define any configurable settings beyond the common settings documented above.
92+
93+
However, note that only the `SqliteConnector` supports the common `EXCLUDE` setting.
94+
8295
#### SqliteBackupConnector
8396

8497
The `dbbackup.db.sqlite.SqliteBackupConnector` makes a copy of the SQLite database file using the `.backup` command, which is safe to execute while the database has ongoing/active connections.
@@ -99,12 +112,20 @@ In-memory databases are **not** dumpable with it. Since it works by copying the
99112

100113
### MySQL
101114

102-
MySQL defaults to `dbbackup.db.mysql.MysqlDumpConnector` which shells out to
103-
`mysqldump` for creation and `mysql` for restore.
115+
#### Settings
104116

105-
### PostgreSQL
117+
MySQL connectors do not define any configurable settings beyond the common settings documented above.
118+
119+
However, note that when the common `EXCLUDE` setting is configured in your Django database, each table name is passed to `mysqldump` as `--ignore-table=<database>.<table>`, so the values should be plain table
120+
names from the target database.
121+
122+
#### MysqlDumpConnector
106123

107-
All PostgreSQL connectors have the following settings:
124+
The `dbbackup.db.mysql.MysqlDumpConnector` creates a SQL dump with `mysqldump` and restores it by piping the dump into `mysql`.
125+
126+
This is the default connector for MySQL databases.
127+
128+
### PostgreSQL
108129

109130
#### Settings
110131

@@ -139,6 +160,15 @@ restoring the database.
139160

140161
### MongoDB
141162

163+
#### Settings
164+
165+
| Setting | Description | Default |
166+
| ------------ | --------------------------------------------------- | ------- |
167+
| OBJECT_CHECK | Validate documents before inserting (`--objcheck`). | `True` |
168+
| DROP | Replace existing objects during restore (`--drop`). | `True` |
169+
170+
#### MongoDumpConnector
171+
142172
MongoDB uses by default `dbbackup.db.mongodb.MongoDumpConnector`. It
143173
uses `mongodump` and `mongorestore` for its job.
144174

@@ -165,25 +195,25 @@ DATABASES = {
165195
}
166196
```
167197

168-
#### Settings
198+
### All Databases (Universal)
169199

170-
| Setting | Description | Default |
171-
| ------------ | --------------------------------------------------- | ------- |
172-
| OBJECT_CHECK | Validate documents before inserting (`--objcheck`). | `True` |
173-
| DROP | Replace existing objects during restore (`--drop`). | `True` |
200+
The Django connector (`dbbackup.db.django.DjangoConnector`) provides database-agnostic backup and restore functionality using Django's built-in `dumpdata` and `loaddata` management commands. This connector works with any Django-supported database backend.
174201

175-
### Django-Prometheus
202+
Key features include:
176203

177-
All supported built-in connectors are described in more detail below. Following database wrappers from `django-prometheus` are supported:
204+
- **Universal compatibility**: Works with any database backend supported by Django
205+
- **No external dependencies**: Uses Django's serialization system
206+
- **Model-level backups**: Preserves foreign key relationships and data integrity
207+
- **JSON format**: Creates human-readable backups in JSON format
178208

179-
- `django_prometheus.db.backends.postgresql`
180-
- `django_prometheus.db.backends.sqlite3`
181-
- `django_prometheus.db.backends.mysql`
182-
- `django_prometheus.db.backends.postgis`
209+
The Django connector is ideal for:
183210

184-
## Django Connector
211+
- Oracle databases (used by default)
212+
- Custom or third-party database backends not explicitly supported
213+
- Development environments where simplicity is preferred
214+
- Cases where external database tools are not available
185215

186-
The Django connector (`dbbackup.db.django.DjangoConnector`) provides database-agnostic backup and restore functionality using Django's built-in `dumpdata` and `loaddata` management commands. This connector works with any Django-supported database backend.
216+
#### DjangoConnector
187217

188218
This connector is automatically used for any unmapped database engines. If needed, you can explicitly configure it:
189219

@@ -195,30 +225,21 @@ DBBACKUP_CONNECTORS = {
195225
}
196226
```
197227

198-
### Key Features
199-
200-
- **Universal compatibility**: Works with any database backend supported by Django
201-
- **No external dependencies**: Uses Django's serialization system
202-
- **Model-level backups**: Preserves foreign key relationships and data integrity
203-
- **JSON format**: Creates human-readable backups in JSON format
204-
205-
### When to Use
206-
207-
The Django connector is ideal for:
208-
209-
- Oracle databases (used by default)
210-
- Custom or third-party database backends not explicitly supported
211-
- Development environments where simplicity is preferred
212-
- Cases where external database tools are not available
213-
214-
### Limitations
228+
#### Limitations
215229

216230
- **Performance**: Slower than native database tools for large datasets
217231
- **Database structure**: Only provides backups of data; not database schema, indices, or procedures
218232

219-
### File Extension
233+
### Django Prometheus (External)
234+
235+
All supported built-in connectors are described in more detail below. Following database wrappers from `django-prometheus` are supported:
236+
237+
- `django_prometheus.db.backends.postgresql`
238+
- `django_prometheus.db.backends.sqlite3`
239+
- `django_prometheus.db.backends.mysql`
240+
- `django_prometheus.db.backends.postgis`
220241

221-
By default, backups use the `.json` extension.
242+
---
222243

223244
## Custom Connectors
224245

0 commit comments

Comments
 (0)