https://github.com/itell-solutions/django_postgres_backup
Django managed commands to backup and restore PostgreSQL databases with multiple generations
https://github.com/itell-solutions/django_postgres_backup
backup django postgresql
Last synced: about 1 year ago
JSON representation
Django managed commands to backup and restore PostgreSQL databases with multiple generations
- Host: GitHub
- URL: https://github.com/itell-solutions/django_postgres_backup
- Owner: itell-solutions
- License: mit
- Created: 2022-08-26T06:17:03.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-18T14:43:08.000Z (over 3 years ago)
- Last Synced: 2025-03-09T12:19:01.631Z (over 1 year ago)
- Topics: backup, django, postgresql
- Language: Python
- Homepage:
- Size: 112 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pypi.org/project/django_postgres_backup/)
[](https://www.python.org/downloads/)
[](https://github.com/itell-solutions/django_postgres_backup/actions/workflows/build.yaml)
[](https://github.com/psf/black)
[](https://opensource.org/licenses/MIT)
# Django managed commands to backup and restore PostgreSQL databases with multiple generations
The `django_postgres_backup` Django module includes managed commands to back
up and restore a PostgreSQL database with time stamped names to provide
multiple backup generations.
## Installation
To install, depending on your package manager, run:
```bash
pip install --update django_postgres_backup
```
or
```bash
poetry add django_postgres_backup
```
## Usage
To add the backup related managed commands to your project, add it to
`settings.INSTALLED_APPS`.
```python
INSTALLED_APPS = [
...,
"django_postgres_backup",
]
```
After this, you can backup the default database by running:
```bash
python manage.py postgres_backup
```
The created backup can now be restored by running:
```bash
python manage.py postgres_backup
```
You can clean and restore a whole database with all the tables and data
```bash
python manage.py postgres_restore --clean --if-exists
```
## Configuration
You can set up how many generations of backup should be saved, all other will be deleted.
```python
POSTGRES_BACKUP_GENERATIONS = 3
```
## Limitations
Backup and restore works only with postgresql.
## License
Copyright (c) 2022 ITELL.SOLUTIONS GmbH, Graz, Austria.
Distributed under the
[MIT license](https://en.wikipedia.org/wiki/MIT_License). For details refer to
the file `LICENSE`.
The source code is available from
.