Extend django-dbbackup to backup s3 data to DropBox
- Django >=3.2, <4.0
- Create a new virtualenv and activate it
- Install the packages -
pip install -r requirements.txt -Uand addstorage_syncto INSTALLED_APPS in Django settings. - Make sure you have set the settings variables for
django-storagepackagesAWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_STORAGE_BUCKET_NAMEAWS_S3_REGION_NAMEDROPBOX_OAUTH2_TOKENDROPBOX_OAUTH2_REFRESH_TOKENDROPBOX_APP_KEYDROPBOX_APP_SECRETDBBACKUP_STORAGE
- Set the values for the following variables in
settings.pySYNC_S3_BUCKET- The name of the bucket to sync (default:settings.AWS_STORAGE_BUCKET_NAME)SYNC_S3_DIR- The directory in the bucket to sync (default:s3-source-dir/)SYNC_DROPBOX_DIR- The directory in the dropbox the backup to be uploaded (default:dropbox-dest-dir/)SYNC_TARGET_FILE_NAME- The custom name of the file to be uploaded (default:backup.tar.gz)
- Run the management command -
python manage.py s3backup(by default the management command will use the values defined in thesettings.py. But, it can be overridden by passing commandline args)- Run
python manage.py s3backup --helpto see all available options (incl. Compression of backup)
- Run
docker run -it --rm -v "$(pwd):/app" python:3.7 bash -c "cd /app; pip install -e .[tests]; pytest"