mingo-app / mingo

Found a bug? have a FR ?
60 stars 2 forks source link

Restore from archive with error #588

Closed jmisur closed 1 year ago

jmisur commented 1 year ago

Describe the bug Mongorestore from archive doesn't work.

I have a gzipped archive with collections from remote database (created with mingo dump). Then I want to restore it to local database, but mongorestore fails due to missing parameter.

Starting mongorestore...
Executing: /opt/homebrew/bin/mongorestore
Params: --uri="mongodb://127.0.0.1:27017/?appName=mingo",--archive="/Users/xyz/archive.gz",--nsTo="test.*",--drop,--gzip
2023-06-13T09:52:18.699+0200    Failed: --nsFrom and --nsTo arguments must be specified an equal number of times
2023-06-13T09:52:18.699+0200    0 document(s) restored successfully. 0 document(s) failed to restore.
--- mongorestore completed ---

--nsFrom would be "dev.*" in my case. Even if nsFrom and nsTo would be the same, mongorestore requires them to be specified.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

tothradoslav commented 1 year ago

To make this work properly, mongorestore needs the name of the original database from which the dump has been created. We added a prompt to enter the name of the original DB and now it works.