-
Notifications
You must be signed in to change notification settings - Fork 6
refactor: clean up mongo script & update mongo client #51
base: master
Are you sure you want to change the base?
Conversation
Add --verbose option, enabled --ssl as previous versions were not using an --ssl connection 😱, using --autheniticationDatabase option to be more clear how the command words, switched to long form param names, removed unnecessary collection drop script for --drop option
It looks like you're not explicitly dropping all collections now, which means if one doesn't appear in the data that we're restoring (because it has already been dropped on production) it won't be dropped. |
Also it looks like it's losing the ability to set a custom port, which is sometimes needed. |
@pauldowman the I was aware of the --drop behaviour but was unsure of how to handle for the first upload. The behaviour of mongorestore is if the If the staging DB has additional collections that were completely dropped from the production DB (something we don't normally do) and are no longer being used in the App if these still persist in the staging DB it wouldn't affect the App in anyway. I also suspect this script will further change once we update to Mongo 3.6. |
OK, the port can just be on the host then if you prefer that.
I disagree that this is OK. It can definitely be a problem. Why not just drop them first as we did before? |
What I'm saying is that |
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.
I'm pretty sure tahtmongorestore
doesn't drop collections that no longer exist, so we need to make sure that happens. I don't think what we have here does that. Adding back the forEach
would fix it, or if there's some nicer way that's fine with me.
This PR includes the changes made to the script to get our mongodump/mongorestore working and to clean up & simplify the process. 🔥
Changes Made: 💃
https
instead ofhttp
. Meteor by default now uses3.4
, next Meteor release will be usingmongo 3.6
and the script will likely be required to be updated again.--verbose
option so we can see the whole process in the logs and verify the outcome or for debugging upon failure or odd behaviour.--ssl
as previous versions were not using an ssl connection to dump & restore the db 😱--autheniticationDatabase
option to be more clear how the two scripts work--drop
option onmongorestore
if we wish to be even more restrictive on what we restore we could add the --nsExclude or --nsInclude options to themongorestore
command.--out
tomongo_dump
asmongodump
is bad naming and can cause confusion as the outpath shared its name with themongodump
command