mongodb-backup
mongodb-backup copied to clipboard
Empty collection folder
Hi there, I faced this issue when export collections: in MondoDB I have not empty collections, but after export I have folders for all collections, but there are no files in these folders. What could be the reason of this issue? Thanks
I am also facing the same problem
this appears to be
db.cursor.snapshot
deprecation
Managed to fix this by downgrading to version 1.4.8
downgrade did not work here. here I use mongo 4.0.1 and this component does not work on it
1.4.8
Downgrade worked
Downgrade too
1.4.8
Downgrade worked
I faced the same issue and had to downgrade mongodb to the latest 3.x release.
any people have really has a real fix?
Facing the same issue :/
same
same
This explains my empty backups..
Failed to parse: { find: "CollectionName", filter: {}, snapshot: true, $db: "DBName" }.
Unrecognized field 'snapshot'
This error gets eaten by the void, because there is no error handler registered for the mongodb stream. Also this should only be happening with MongoDB in version 4, downgrading to 3.6 may help!
Managed to fix this by downgrading to version 1.4.8
This entirely skips the snapshot option!
Replacing
var stream = collection.find(query).snapshot(true).stream()
with
var stream = collection.find({ $query: query, $snapshot: true }).stream()
also seems to fix the issue?
@Phoscur I was just about to submit a PR with the same change (after I debugged myself instead of looking at existing issues - stupid me)
Thanks! Let's hope it'll be merged soon ;)
In meantime use https://www.npmjs.com/package/mongodb-backup-4x Runs fine but I still haven't rolled it out to deployments, lacking time myself.. I would prefer it being merged and tested a lot more :(
This includes fixes from https://github.com/spmiller/mongodb-backup/pull/5
Please review and test, maybe at some point we can even get this merged back. It seems not soon though?? @hex7c0
Is there any update here? I really want to use mongo 4 with this package and when a fix is found and a pr is open, so when will it be merged?
Thanks in advance :)
Managed to fix this by downgrading to version 1.4.8
Downgrade worked with Mongo 3.4
It's 2019 and you are still downgrading?? Have a look at this
In meantime use https://www.npmjs.com/package/mongodb-backup-4x
I was hoping to get some feedback on how it works, but no feedback is good feedback I guess. We are still looking for someone to really maintain this project since @hex7c0 is unresponsive.
Guys, I just solved the problem.
Mongodb just deprecated the method snapshot() and that's why the code didn't work.
Here is my branch
And quick start by : npm install mongodb-backup-fixed
Have fun and wish a star.
So what fixes did you include I didn't? @XiaYaoShiXin Why should we choose your package instead of mine with all the other bugfixes from the other PRs?
https://www.npmjs.com/package/mongodb-backup-4x
@XiaYaoShiXin maybe create a pr or publish a new package in npm so that we can all use it with ease
No the problem is not that we need more PRs for the same thing. This issue would be solved if this repo would be maintained. @XiaYaoShiXin @hex7c0 Overhead is just increasing with additional npm package alternatives!!
@Keramet would you please update the main issue content so pleople don't miss the fact that this is actually solved already (just not merged)?
@Phoscur Pleas update your Git Repo with - npm i mongodb-backup-4x instead of old one
@Ishu1998 sorry I don't understand your comment, are you telling me to install my own package?
Or are you asking to maintain the package? Can you please be more specific?
@Keramet
would you please update the main issue content so pleople don't miss the fact that this is actually solved already (just not merged)?
@hex7c0 please please do something here, this is getting out of hand and wasting everyones time.
It seems like this library is dead. 4 years last contribution...
Ive created my own solution for mongodb backup. will appreciate contribution! https://github.com/lihaibh/mongodb-snapshot
Great alternative, thanks @lihaibh 👏