On an installation of Sitecore 8.2 update 4, the mongo connection appears to work fine. After upgrading to Sitecore 8.2 update 6 mongo is stating that the connection string is not valid.

The connection string 'mongodb://username:[email protected]:port138192/databasename?replicaSet=rs-servername;ssl=true' is not valid.

What may have happened to cause this and how can I get it working?

1 Answer 1


The MongoDB driver between the two version changed, which includes a refactoring of the validation for connection strings.

Checking with MongoDB.Driver.dll the version details can be seen as the following:

  • Sitecore 8.2.4 the MongoDB driver is
  • Sitecore 8.2.6 the MongoDB driver is

Each file uses a regular expression to verify the format of the connection string. I discovered that the password I was provided has a colon : in it which needs to be escaped.


The solution here is to encode the colon using %3A.


Similarly, if you have an @ symbol you should replace it with %40.

Note: Only encode the password. The : and @ are also used in the connection string as delimiters which should go untouched.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.