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.10 - 3.14, Django 4.2 - 6.0, Psycopg 2 - 3, and Postgres 14 - 18.

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.8.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_pgclone-3.8.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_pgclone-3.8.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.0 Linux/6.8.0-1040-aws

File hashes

Hashes for django_pgclone-3.8.0.tar.gz
Algorithm Hash digest
SHA256 f8e67bc8d2dc00cb1b6a5aa83bd2be85f5fc2d9124c807526f34f64bfcd56fcd
MD5 99afe57a1d7c599b68bc10632759cb3d
BLAKE2b-256 17b54e80d1153bf746d4ea7db16c8059ddf3a4507dd1d1d3bfe7cccc6a0ba1d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_pgclone-3.8.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.0 Linux/6.8.0-1040-aws

File hashes

Hashes for django_pgclone-3.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57a2ff119493f38708c54e64ef22a616f29408f4dff84b933e62e6cabecc5f65
MD5 a480b24430591dbcc3cf54acee65c249
BLAKE2b-256 d422af97557122390dbce217040315cdb48d9d99114704815328f92e3e12387c

See more details on using hashes here.

Supported by

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