compsci-adl / duckbot

CS Club's Discord bot
MIT License
5 stars 9 forks source link

[Feature Request] Database Backup #33

Open CrageJ opened 1 month ago

CrageJ commented 1 month ago

Overview

Database may need reverting to an earlier version if there are user or operational errors. Creating a backup of recent versions of the database would be helpful in such a situation.

Details

Create a separate folder like db_backups to store a snapshot of all databases each day, for up to 72 hours,

Why would this feature be useful?

Catastrophic errors or misuse may render certain functionalities useless until they are fixed. having a copy before things "went bad" seems like the responsible thing to do.

Additional Notes

No response

phoenixpereira commented 1 month ago

Also pushing a change to production seems to delete the database.

CrageJ commented 1 month ago

@phoenixpereira Can you find a way to keep persistent storage between sessions/merges? If everything gets overwritten whenever there's a merge then it's an issue that has to be addressed with the deployment environment.

Maybe look at EBS or S3?

I will see about implementing an on_shutdown() process as well

phoenixpereira commented 1 month ago

@phoenixpereira Can you find a way to keep persistent storage between sessions/merges? If everything gets overwritten whenever there's a merge then it's an issue that has to be addressed with the deployment environment.

Maybe look at EBS or S3?

I will see about implementing an on_shutdown() process as well

Fixed in #39/#40.

rayokamoto commented 1 month ago

We might set up a cron job to backup the database to S3 as well, and if that's done this issue can be closed