Meteor-CollectionFS
Meteor-CollectionFS copied to clipboard
s3: proper way to mongorestore
Everytime I run a mongorestore, my s3 bucket reverts back to some earlier state - not all files are deleted, but most are.
What's the proper way to restore a db backup without overwriting all the s3 data? Should I exclude some collection?
Sounds like the backup is removing documents from your collection? If so isn't the removal of store data in S3 desired?
I had the same problem, almost hit the production server. Its some cleanup logic in CFS that tries to remove files not referenced anymore.
See here: https://github.com/CollectionFS/Meteor-CollectionFS/blob/f28a3fcbfe86b999fcb2896363134fa9753d152e/packages/worker/fileWorker.js#L55
Yep, I have this problem too, multiple environments are using the same store, and data being pushed around between them results in vanished files.
@strikeout did you just overwrite this method?
Hey guys - just FYI, looks like I solved this by using --excludeCollection=cfs.[your-collection].filerecord so file collections don't get overwritten. One thing to note however is that you'll probably want to organize a couple instances of storage locations so production files aren't so easily manipulated by non-production ones etc. You can then write specific scripts to move the files collections to and from as well. Not the nicest solution, but will be fine once migration scripts are updated accordingly.