Skip to main content

Django managed commands to back up and restore a PostgreSQL database with multiple backup generations.

Project description

PyPI Python Versions Build Status Black License

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:

pip install --update django_postgres_backup

or

poetry add django_postgres_backup

Usage

To add the backup related managed commands to your project, add it to settings.INSTALLED_APPS.

INSTALLED_APPS = [
    ...,
    "django_postgres_backup",
]

After this, you can backup the default database by running:

python manage.py postgres_backup

The created backup can now be restored by running:

python manage.py postgres_backup

You can clean and restore a whole database with all the tables and data

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.

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. For details refer to the file LICENSE.

The source code is available from https://github.com/itell-solutions/django_postgres_backup.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_postgres_backup-1.0.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

django_postgres_backup-1.0.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file django_postgres_backup-1.0.0.tar.gz.

File metadata

  • Download URL: django_postgres_backup-1.0.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.7 Darwin/21.6.0

File hashes

Hashes for django_postgres_backup-1.0.0.tar.gz
Algorithm Hash digest
SHA256 784694fbcefe7fd493fd29f89704f63e660144ddc910e138faa04e291255a253
MD5 117f83331163861ee0a5273a69634731
BLAKE2b-256 b174fc6291f84da73a4740262548d1219a6702d635349657a42f7e014626176a

See more details on using hashes here.

File details

Details for the file django_postgres_backup-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_postgres_backup-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b5949dda4eda0eb28f3d4410662678a4c93755eaf57a931c7af7dbe4d22a096
MD5 4fb752552fb95c4dd7a525d7cd04bb19
BLAKE2b-256 776879e6ef77afe45cfcb41ccf629ef3f8cd89e3e06990e25e42509955b907ab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page