Skip to main content

Backup, Sync and Restore Databases and Media

Project description

Django sync env

django-sync-env is a Django app to manage backing up and restoring django databases and media assets easily.

Detailed documentation is in the "docs" directory (it's a work in progress).

Requirements:

  • configurable backups and restore which can be run on demand, celery cron or in dev.
  • support s3 bucket and file storage options first, add azure blob storage later
  • interactive prompts for local dev
  • command line options with --no-input for CICD and automations
  • restore latest option for media and backups for X env
  • backup before restore option

Setup

  1. Add "django_sync_env" to your INSTALLED_APPS setting like this:
   INSTALLED_APPS = [
   ...,
   "django_sync_env",
   ]
  1. Configure the app via a settings file .typically ./settings/partial/sync_env.py for base configuration, don't forget to import this file via your base.py settings file And override any required settings per environment via ./settings/partials/[env].py see example_partials

There is a s3 terraform example for provisioning an aws s3 bucket, iam user, roles and policy to allow for remote backup/restore to/from a secure s3 bucket.

See management commands for more details for each of the commands available.

  • ./manage.py sync_env_backup_db usage
  • ./manage.py sync_env_backup_media
  • ./manage.py sync_env_restore_db
  • ./manage.py sync_env_restore_media
  • ./manage.py sync_env_list_backups

See Tasks for more details for each of the tasks available.

Development and Publishing

See documentation.

TODO:

  • remove command options which we wont use
  • make sure all management commands work with good error logging and handling
  • Update the sync-env-backup command to enable the option to specify particular databases
  • Update the sync-env-backup command to exclude particular tables in particular databases

Project details


Release history Release notifications | RSS feed

This version

0.3.2

Download files

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

Source Distribution

django_sync_env-0.3.2.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

django_sync_env-0.3.2-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

Details for the file django_sync_env-0.3.2.tar.gz.

File metadata

  • Download URL: django_sync_env-0.3.2.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.10.7-orbstack-00280-gd3b7ec68d3d4

File hashes

Hashes for django_sync_env-0.3.2.tar.gz
Algorithm Hash digest
SHA256 41fa69fca99bab0e579ac335646a44b1bea5f228a4f81ca9d3ef748b63212423
MD5 6bb1a30fee786f18b5b334b0d3814964
BLAKE2b-256 4101ff6d96a346cfa9ac153e24b1216cf6e2c4a43c8d528ddddebb90a4861542

See more details on using hashes here.

File details

Details for the file django_sync_env-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: django_sync_env-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 33.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.10.7-orbstack-00280-gd3b7ec68d3d4

File hashes

Hashes for django_sync_env-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c45c613bd7f7ac8c0e95447d97898776afba2dd0cdc7a1d38791e232cc12749f
MD5 29870202ed5744d98809a001a34056db
BLAKE2b-256 37de41eac8be515331141e11a594877914dbd3ef0ab40469eed38eae2d9c1629

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