[Yandex Cloud documentation](../../../index.md) > [Yandex Data Transfer](../../index.md) > [Step-by-step guides](../index.md) > [Configuring endpoints](index.md) > Migrating endpoints to a different availability zone

# Migrating a Data Transfer transfer and endpoints to a different availability zone


You can migrate [transfers](../../concepts/index.md#transfer) from one [availability zone](../../../overview/concepts/geo-scope.md) to another. The migration method depends on which service is used as the transfer endpoint: a [custom DB installation](#on-premise) or a [Yandex Cloud managed DB](#managed-service). If [migrating data](../../tutorials/index.md#migration) between a custom installation and a managed DB, you should first move the endpoint based on a custom installation and then the one based on a managed DB.

## Moving an endpoint based on a custom installation {#on-premise}

1. If the [transfer type](../../concepts/transfer-lifecycle.md#transfer-types) is **Replication** or **Snapshot and increment**, [deactivate](../transfer.md#deactivate) the transfer and wait for its status to change to **Stopped**.
1. [Create a subnet](../../../vpc/operations/subnet-create.md) in the availability zone you want to move your endpoint to.
1. If your custom installation is hosted on a Yandex Cloud VM, follow these steps:

   
   1. [Stop the VM](../../../compute/operations/vm-control/vm-stop-and-start.md#stop).
   1. [Move the VM to a different availability zone](../../../compute/operations/vm-control/vm-change-zone.md).
   1. [Run the VM](../../../compute/operations/vm-control/vm-stop-and-start.md#start).


1. [Specify a new subnet](index.md#update) in the settings of the endpoint with your custom installation.
1. If you deactivated the transfer earlier, [activate](../transfer.md#activate) it and wait for its status to change to **Replicating**.

   {% note warning %}

   If your transfer includes an endpoint based on a managed DB, [migrate](#managed-service) this endpoint to a different availability zone before activating the transfer.

   {% endnote %}

## Moving an endpoint based on a managed DB {#managed-service}

1. Move your cluster hosts to a different availability zone. For more information, refer to the relevant guides:

   * [Yandex Managed Service for ClickHouse®](../../../managed-clickhouse/operations/host-migration.md)
   * [Yandex StoreDoc](../../../storedoc/operations/host-migration.md)
   * [Yandex Managed Service for MySQL®](../../../managed-mysql/operations/host-migration.md)
   * [Yandex Managed Service for OpenSearch](../../../managed-opensearch/operations/host-migration.md)
   * [Yandex Managed Service for PostgreSQL](../../../managed-postgresql/operations/host-migration.md)   * [Yandex Managed Service for YDB](../../../ydb/operations/migration-to-an-availability-zone.md)

1. If the [transfer type](../../concepts/transfer-lifecycle.md#transfer-types) is **Replication** or **Snapshot and increment**, restart the transfer for it to get the information about the new cluster topology. You do not need to restart **Snapshot** transfers, as information about the new topology is provided automatically upon their activation.

   To restart a transfer, choose one of the two methods:
   
   * [Deactivate](../transfer.md#deactivate) the transfer and wait for its status to change to **Stopped**. Next, [reactivate](../transfer.md#activate) the transfer and wait for its status to change to **Replicating**.
   * Update any [setting for the transfer](../transfer.md#update) or [endpoint](index.md#update).

_ClickHouse® is a registered trademark of [ClickHouse, Inc](https://clickhouse.com)._