Skip to main content

Dump and restore Postgres databases with Django.

Project description

django-pgclone

django-pgclone makes it easy to dump and restore Postgres databases. Here are some key features:

  1. Streaming dumps and restores to configurable storage backends like S3. Instances with limited memory aren't a problem for large databases.
  2. A restoration process that works behind the scenes, swapping in the restored database when finished.
  3. Configurable hooks into the dump and restore process, for example, migrating a restored database before it is swapped.
  4. Reversible restores, making it possible to quickly revert to the initial restore or the previous database.
  5. Re-usable configurations for instrumenting different types of dumps and restores.

Quickstart

To dump a database, do:

python manage.py pgclone dump

To list database dump keys, do:

python manage.py pgclone ls

To restore a datase, do:

python manage.py pgclone restore <dump_key>

Database dumps are relative to the storage location, which defaults to the local file system. Dump keys are in the format of <instance>/<database>/<config>/<timestamp>.dump.

When listing, use an optional prefix. Restoring supports the same interface, using the latest key that matches the prefix.

Documentation

View the django-pgclone docs here to learn more about:

  • The basics and an overview of how it works.
  • The core command docs.
  • Configuring an S3 storage backend.
  • Running management command hooks during dumping or restoring.
  • Creating restores that can be quickly reverted.
  • Re-using command parameters for different flows.
  • All settings.
  • Additional details on using AWS RDS databases.

Compatibility

django-pgclone is compatible with Python 3.9 - 3.13, Django 4.2 - 5.1, Psycopg 2 - 3, and Postgres 13 - 17.

Installation

Install django-pgclone with:

pip3 install django-pgclone

After this, add pgclone to the INSTALLED_APPS setting of your Django project.

Note Install the AWS CLI to enable the S3 storage backend. Use pip install awscli or follow the installation guide here.

Contributing Guide

For information on setting up django-pgclone for development and contributing changes, view CONTRIBUTING.md.

Primary Authors

  • @wesleykendall (Wes Kendall)
  • @ethanpobrien (Ethan O'Brien)

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_pgclone-3.6.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

django_pgclone-3.6.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file django_pgclone-3.6.0.tar.gz.

File metadata

  • Download URL: django_pgclone-3.6.0.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/5.15.0-1057-aws

File hashes

Hashes for django_pgclone-3.6.0.tar.gz
Algorithm Hash digest
SHA256 76d4285e0ac3394792c0aaae5dabfa5e0a7856f476149c4394b3fcd3454c21c4
MD5 d2ebc206dae38e86054ab3e945973c4e
BLAKE2b-256 1a6b5aa85e510450ceb4ff4c609750904321761319addd4c7a455fddc8f25f0b

See more details on using hashes here.

File details

Details for the file django_pgclone-3.6.0-py3-none-any.whl.

File metadata

  • Download URL: django_pgclone-3.6.0-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/5.15.0-1057-aws

File hashes

Hashes for django_pgclone-3.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db4ebc0858d6de057042f2f9c66b6d4515c9c151e6db97a33445032fe8cd87d9
MD5 0d1f86164e064083e232b3aaf02d91c8
BLAKE2b-256 de7b58e5369f7e60d677a55bb3286e87836e0db0e3293dd96b32bf69d70b2f45

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