I have a difference between Windows10 & Linux doing the exact same operation:
Restoring a ‘dump’ into a different database.
I’m creating a ‘staging’ db from Live, so initially I create the new db using:
mongorestore --host= --username --password --authenticationDatabase=admin --nsFrom=db.* --nsTo=new-db.* --db=db --gzip ./backups/2020-12-01/db --verbose
** This works just fine on both platforms.
For daily updates, I want to update all collections, except 1. Works fine in Windows (dev), but not Linux (production)
mongorestore --host= --username --password --authenticationDatabase=admin --nsFrom=db.* --nsTo=new-db.* --db=db --gzip ./backups/2020-12-02/db --nsExclude db.settings --drop --preserveUUID ./backups/2020-12-03/db --verbose
I’ve narrowed it down to the ‘–preserveUUID’.
The error in Linux I get is:
Failed: new-db.test: error creating collection new-db.test: applyOps: (Location40655) Invalid name new-db.test for UUID 1da7ab34-65b9-4a2a-b613-acf7ad2b5b5a
I have absolutely no idea what this means, nor have I found any clues extensively searching Google and other forums.
My Mongo is 4.2. I upgraded ‘mongorestore’ to 100.2.1 on Linux- no change. Am flying blind.
Any ideas that I can pursue?
Thanks