mingo-app / mingo

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

mongorestore --nsFrom and --nsTo arguments must be specified error #579

Open emehmet opened 1 year ago

emehmet commented 1 year ago

Hello,

I dumped my db correctly to an archive file. But I couldn't restore my backup correctly. I got this error ;

Starting mongorestore...
Executing: C:\Program Files\MongoDB\Tools\100\bin\mongorestore.exe
Params: --uri="mongodb://127.0.0.1:27017/?appName=mingo",--archive="C:\Users\emehm\OneDrive\Desktop\mestgps.archive",--nsTo="mestgps.*"
2023-05-23T15:38:30.906+0300    Failed: --nsFrom and --nsTo arguments must be specified an equal number of times
2023-05-23T15:38:30.968+0300    0 document(s) restored successfully. 0 document(s) failed to restore.
--- mongorestore completed ---

Mongodb 6.0.5 Mingo 1.13.0 Windows 10

Icaruk commented 1 year ago

If your db origin and destination names are different, you can to restore manually with:

mongorestore --uri="mongodb+srv://xxx:xxx/destination_db_name" --drop --archive="./your_file.archive" --nsFrom="origin_db_name.*" --nsInclude="origin_db_name.*" --nsTo="destination_db_name.*"
tothradoslav commented 1 year ago

We will improve this in mingo and make it possible to control all the details.