Skip to content

Backup script#128

Merged
ckcollab merged 4 commits intodevelopfrom
backup-script
Apr 29, 2020
Merged

Backup script#128
ckcollab merged 4 commits intodevelopfrom
backup-script

Conversation

@ckcollab
Copy link
Copy Markdown
Contributor

@ckcollab ckcollab commented Apr 20, 2020

@ mention of reviewers

@gibsonbailey

Resolves #139

A checklist for hand testing

  • ./bin/pg_dump.sh works local, saves file to minio private storage /backups dir
  • (if we switch branch on prod to this and run the script) On prod storage backups are being saved from cron job
  • Few commands added:
  • ./manage.py list_backups <search>
  • ./manage.py download_backup <dump name from above search>
  • ./bin/pg_restore.sh <dump name from download>

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • Ready to merge

Copy link
Copy Markdown
Collaborator

@gibsonbailey gibsonbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, and it works great! However, I think it would be much more usable if we had a two other commands:

  1. List dumps that exist in the backups directory
  2. Load an existing backup dump by name

It's not necessarily difficult to use, but it requires the usage of the minio client which CAN be irritating to set up.

Also, thank you for building this 🙏.

@ckcollab
Copy link
Copy Markdown
Contributor Author

ckcollab commented Apr 29, 2020

I added the commands...

./manage.py list_backups <search>
./manage.py download_backup <dump name from above search>
./bin/pg_restore.sh <dump name from download>

Also made everything private by default .. but all current File/ImageFields should be public anyway. Protects us in the future if someone makes an oversight, something we want to be private won't be public by accident (hopefully!)

EDIT: Merged in conflicts, looks like PublicStorage was already added with explicit S3 stuff, I think the way I did it should work OK locally? can you confirm @brendon-lind ?

@ckcollab ckcollab merged commit 8e4822d into develop Apr 29, 2020
@ckcollab ckcollab deleted the backup-script branch April 29, 2020 22:03
@brendon-lind brendon-lind mentioned this pull request May 6, 2020
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create easy-backup scripts

2 participants