run upgrade check earlier so nothing new may try to log while new database is not created yet