diff -u b/core/includes/install.core.inc b/core/includes/install.core.inc --- b/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -412,16 +412,6 @@ // accessing the database before it is set up yet.) drupal_maintenance_theme(); - // Ensure that the active configuration directory is empty if it is - // configured. - if ($install_state['config_verified']) { - $config = glob(config_get_config_directory(CONFIG_ACTIVE_DIRECTORY) . '/*.' . FileStorage::getFileExtension()); - if (!empty($config)) { - $task = NULL; - throw new Exception(install_already_done_error()); - } - } - if ($install_state['database_verified']) { // Initialize the database system. Note that the connection // won't be initialized until it is actually requested. @@ -439,6 +429,16 @@ } } + // Ensure that the active configuration directory is empty before installation + // starts. + if ($install_state['config_verified'] && empty($task)) { + $config = glob(config_get_config_directory(CONFIG_ACTIVE_DIRECTORY) . '/*.' . FileStorage::getFileExtension()); + if (!empty($config)) { + $task = NULL; + throw new Exception(install_already_done_error()); + } + } + // Modify the installation state as appropriate. $install_state['completed_task'] = $task; $install_state['database_tables_exist'] = !empty($task);