mongodb-backup icon indicating copy to clipboard operation
mongodb-backup copied to clipboard

Empty collection folder

Open geka-evk opened this issue 7 years ago • 30 comments

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

geka-evk avatar Sep 20 '18 10:09 geka-evk

I am also facing the same problem

dipgupta1986 avatar Sep 20 '18 15:09 dipgupta1986

this appears to be

db.cursor.snapshot

deprecation

cucabr avatar Sep 23 '18 14:09 cucabr

Managed to fix this by downgrading to version 1.4.8

EdyKovacs avatar Sep 24 '18 15:09 EdyKovacs

downgrade did not work here. here I use mongo 4.0.1 and this component does not work on it

cucabr avatar Sep 25 '18 20:09 cucabr

1.4.8

Downgrade worked

shahidcodes avatar Oct 19 '18 18:10 shahidcodes

Downgrade too

1.4.8

Downgrade worked

iedsilva avatar Oct 24 '18 23:10 iedsilva

I faced the same issue and had to downgrade mongodb to the latest 3.x release.

dgimb89 avatar Jan 11 '19 09:01 dgimb89

any people have really has a real fix?

PourrezJ avatar Jan 19 '19 18:01 PourrezJ

Facing the same issue :/

natanrolnik avatar Jan 30 '19 22:01 natanrolnik

same

dusttier avatar Mar 29 '19 04:03 dusttier

same

sam13591980 avatar May 05 '19 17:05 sam13591980

This explains my empty backups..

Phoscur avatar May 12 '19 13:05 Phoscur

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!

Phoscur avatar May 12 '19 14:05 Phoscur

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 avatar May 12 '19 14:05 Phoscur

@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 ;)

tennox avatar May 21 '19 08:05 tennox

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

Phoscur avatar May 24 '19 18:05 Phoscur

Please review and test, maybe at some point we can even get this merged back. It seems not soon though?? @hex7c0

Phoscur avatar Jun 04 '19 19:06 Phoscur

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 :)

JustDoItSascha avatar Aug 21 '19 08:08 JustDoItSascha

Managed to fix this by downgrading to version 1.4.8

Downgrade worked with Mongo 3.4

josechavarriacr avatar Nov 19 '19 17:11 josechavarriacr

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.

Phoscur avatar Nov 19 '19 19:11 Phoscur

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.

zhikun-hou avatar Dec 18 '19 11:12 zhikun-hou

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

Phoscur avatar Dec 18 '19 12:12 Phoscur

@XiaYaoShiXin maybe create a pr or publish a new package in npm so that we can all use it with ease

shahidcodes avatar Dec 18 '19 12:12 shahidcodes

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!!

Phoscur avatar Dec 18 '19 12:12 Phoscur

@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 avatar Dec 18 '19 12:12 Phoscur

@Phoscur Pleas update your Git Repo with - npm i mongodb-backup-4x instead of old one

Ishu1998 avatar May 01 '20 23:05 Ishu1998

@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?

Phoscur avatar May 02 '20 15:05 Phoscur

@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.

Phoscur avatar May 02 '20 19:05 Phoscur

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

lihaibh avatar Sep 07 '20 03:09 lihaibh

Great alternative, thanks @lihaibh 👏

OlivierChirouze avatar Nov 09 '22 17:11 OlivierChirouze