@Madchatthew still a great catch.
mongorestore "E11000 duplicate key error collection"
Solved
Configure
-
During the restore of a MongoDB based database, you may receive the error message
E11000 duplicate key error collection
This is because by default the
mongorestore
command does not drop existing collections before attempting to recover them, which results in the above error message as the collections already existAs an example, the command of
sudo mongorestore -d sudonixdev /path/to/database/sudonix -u admin -p <password> --authenticationDatabase=admin
Would need to become
sudo mongorestore --drop -d sudonixdev /path/to/database/sudonix -u admin -p <password> --authenticationDatabase=admin
The addition of
--drop
allows the collections to be overwritten by the restore. -