Ordinary database engine is deprecated but there is no simple mean to change database engine to Atomic for existing databases.

Possible options:
- ALTER DATABASE MODIFY ENGINE query.
- Flag that triggers migration at ClickHouse startup.

The latter should be easier to implement. 

{
    
    
    Poco::Logger * log = &Poco::Logger::get("loadMetadata");
    String name = database->getDatabaseName();
    String tmp_name = fmt::format(".tmp_convert.{}.{}", name, thread_local_rng());
    String name_quoted = backQuoteIfNeed(name);
    String tmp_name_quoted = backQuoteIfNeed(tmp_name);
    LOG_INFO(log, "Will convert database {} from Ordinary to Atomic", name_quoted);
    String create_database_query = fmt::format("CREATE DATABASE IF NOT EXISTS {}", tmp_name_quoted);
    auto res = executeQuery(create_database_query, context, true);
    executeTrivialBlockIO(res, context);
    res = {};
    auto tmp_database = DatabaseCatalog::instance().getDatabase(tmp_name);
    assert(tmp_database->getEngineName() == "Atomic");
    size_t num_tables = 0;
    for (auto iterator = database->getTablesIterator(context); iterator->isValid(); iterator->next())
    {