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. 

{
    
    if (!has_metadata_in_zookeeper.has_value() || !*has_metadata_in_zookeeper)
        return;
    try
    {
        InterserverIOEndpointPtr data_parts_exchange_ptr = std::make_shared<DataPartsExchange::Service>(*this);
        [[maybe_unused]] auto prev_ptr = std::atomic_exchange(&data_parts_exchange_endpoint, data_parts_exchange_ptr);
        assert(prev_ptr == nullptr);
        getContext()->getInterserverIOHandler().addEndpoint(data_parts_exchange_ptr->getId(replica_path), data_parts_exchange_ptr);
        startBeingLeader();
        
        restarting_thread.start();
        
        
        
        
        startup_event.wait();
        startBackgroundMovesIfNeeded();
        part_moves_between_shards_orchestrator.start();
    }
    catch (...)
    {
        
        
        
        try