# Копирование таблиц между кластерами Clickhouse

Для копирования таблиц между кластерами Кликхауса можно воспользоваться функцией [remoteSecure](https://clickhouse.com/docs/en/sql-reference/table-functions/remote). Пример настройки модели dbt:

```sql
{{
    config(
        partition_by=["StartDate"],
        engine="VersionedCollapsingMergeTree(Sign, VisitVersion)",
        order_by=["StartDate", "VisitID", "VisitVersion"],
        materialized="incremental",
        incremental_strategy="insert_overwrite",
        ttl="StartDate + INTERVAL 30 DAY TO DISK 'object_storage'",
        schema="metrika-pro",
    )
}}
select *
from
    remoteSecure(
        'host.mdb.yandexcloud.net',
        'database',
        'visits_***',
        'username',
        'password'
    )
where
    StartDate > '2024-10-20'
    and StartDate
    between '2024-10-01' and '2024-10-05'

```