Ok, I am suffering exactly a same problem descripted in this article:
http://blogs.technet.com/b/identitymanagement/archive/2015/08/07/mim-2016-upgrade-issues-on-builds-4-1-3646-0-or-4-1-3634-0-or-4-1-3627-0.aspx
The workaround is replace Microsoft.IdentityManagement.DatabaseUpgrade.exe.config file with another one.
The problem is that I am still getting the same error and facing the problem. So is that file which can be downloaded from the link above broken allready or am I missing something?
Am I the only one who is suffering with this?