Mongorestore options recommendations

Hi Sebastian,

I’ve restored mongodump backups using mongorestore successfully using the following command:

        `process.StartInfo.Arguments = $" {options.MongoDb.Uri} --archive=\"{file}\" --gzip --drop --objcheck --stopOnError";`

What I’m wondering is and what I would like to get some advice on is some of the mongorestore options that are available and that I’m unsure whether to use or not, or just leave them set to their default value? I don’t want to break any users, roles, db, collections or any relationships between the different database objects, or leave the db in an inconsistent state that could bite me further down the road :slight_smile:

Here are the options that I’m unsure about:

(Docs/mongorestore options source)

--objcheck
--drop
--preserveUUID
--convertLegacyIndexes
--keepIndexVersion
--noIndexRestore
--restoreDbUsersAndRoles
--maintainInsertionOrder

I’d really appreciate some guidance here since there’s no one else that knows the ins and out better than you!

None of them really matters. If you skip indexes for example Squidex recreates them. Sometimes it is necessary when indexes are not compatible.

I use this container: https://github.com/SebastianStehle/MongoBackup