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:
- Streaming dumps and restores to configurable storage backends like S3. Instances with limited memory aren't a problem for large databases.
- A restoration process that works behind the scenes, swapping in the restored database when finished.
- Configurable hooks into the dump and restore process, for example, migrating a restored database before it is swapped.
- Reversible restores, making it possible to quickly revert to the initial restore or the previous database.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76d4285e0ac3394792c0aaae5dabfa5e0a7856f476149c4394b3fcd3454c21c4 |
|
MD5 | d2ebc206dae38e86054ab3e945973c4e |
|
BLAKE2b-256 | 1a6b5aa85e510450ceb4ff4c609750904321761319addd4c7a455fddc8f25f0b |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | db4ebc0858d6de057042f2f9c66b6d4515c9c151e6db97a33445032fe8cd87d9 |
|
MD5 | 0d1f86164e064083e232b3aaf02d91c8 |
|
BLAKE2b-256 | de7b58e5369f7e60d677a55bb3286e87836e0db0e3293dd96b32bf69d70b2f45 |