-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added backup/restore #501
Conversation
Codecov Report
@@ Coverage Diff @@
## master #501 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 90 92 +2
Lines 3333 3385 +52
Branches 557 561 +4
=========================================
+ Hits 3333 3385 +52
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Wow @chrisleekr |
@habibalkhabbaz |
Sure, gonna try it this evening based on my timezone (around 7 AM based on AEST). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a cool update @chrisleekr 🚀
I only face a small issue since I have different values in my .env
file.
Based on that, I added some comments.
@habibalkhabbaz I've updated the code. Please review and let me know if you are happy with the fix. :) |
Thanks for the update @chrisleekr Anyway, I tried to back up and restore my DB with the latest update and it is working like a charm even if I have different values in the |
:yay: Thanks @habibalkhabbaz |
Description
This PR is to support the backup/restore.
There are two main scripts:
scripts/backup.sh
: It will usemongodump
to archive all collections excepttrailing-trade-logs
.scripts/restore.sh
: It will usemongorestore
from the backup archive. Note that it will drop existing collections and replace them with the backup archive. After restoring success, it will flush the cache in Redis. Once it's done, it will kill the node to restart the container. Once the container is restarted, it will try to re-run the migration to make it up to date.Related Issue
N/A
Motivation and Context
I will have a big migration and I will need to test multiple times. So backup/restore will be handy for testing.
How Has This Been Tested?
I tested on my end.
Screenshots (if appropriate):