# Managing transfer process

You can:
* [Get a list of transfers](#list).
* [Get detailed information about a transfer](#get).
* [Create a transfer](#create).
* [Update a transfer](#update).
* [Activate a transfer](#activate).
* [Deactivate a transfer](#deactivate).
* [Delete a transfer](#delete).


For more information about [transfer](../concepts/index.md#transfer) states, possible operations on transfers, and existing limits, see [Transfer types and lifecycles](../concepts/transfer-lifecycle.md).

To move a transfer and [endpoints](../concepts/index.md#endpoint) to a different [availability zone](../../overview/concepts/geo-scope.md), follow [this guide](endpoint/migration-to-an-availability-zone.md).

## Getting a list of transfers {#list}

{% list tabs group=instructions %}

- Management console {#console}

  1. Open the [folder dashboard](https://console.yandex.cloud).
  1. Navigate to **Data Transfer**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/arrow-right-arrow-left.svg) **Transfers**.

  You can filter the list of transfers by available parameters:
  * Endpoint or transfer name.
  * Source and target database type.
  * Transfer type.
  * Transfer stage.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  To get a list of transfers in a [folder](../../resource-manager/concepts/resources-hierarchy.md#folder), run the following command:

  ```bash
  yc datatransfer transfer list
  ```


- API {#api}

  Use the [list](../api-ref/Transfer/list.md) API method.


{% endlist %}

## Getting detailed information about a transfer {#get}

{% list tabs group=instructions %}

- Management console {#console}

    1. Open the [folder dashboard](https://console.yandex.cloud).
    1. Navigate to **Data Transfer**.
    1. In the left-hand panel, select ![image](../../_assets/console-icons/arrow-right-arrow-left.svg) **Transfers**.
    1. Click the required transfer name.

- CLI {#cli}

    If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

    The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

    To get information about a transfer, run the following command:

    ```bash
    yc datatransfer transfer get <transfer_ID>
    ```

    You can get the transfer ID with the [list of transfers in the folder](#list).


- API {#api}

    Use the [get](../api-ref/Transfer/get.md) API method and provide the transfer ID value in the `transferId` request parameter.

    To find out the transfer ID, [get a list of transfers in the folder](#list).


{% endlist %}

## Creating a transfer {#create}

{% list tabs group=instructions %}

- Management console {#console}

  1. Open the [folder dashboard](https://console.yandex.cloud).
  1. Navigate to **Data Transfer**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/arrow-right-arrow-left.svg) **Transfers**.
  1. Click **Create transfer**.
  1. Select the source endpoint or [create](endpoint/index.md#create) a new one.
  1. Select the target endpoint or [create](endpoint/index.md#create) a new one. Make sure the [subnet](../concepts/network.md) specified for the target endpoint belongs to the same availability zone as the subnet for the source endpoint.
  1. Specify the transfer parameters:
     * **Name**.
     * **Description**. This is an optional setting.
     * **Transfer type**:
       * **Snapshot**: Creates a full copy of data without receiving further updates from the source.
         * **Periodic snapshot**: Enable to create a full copy of your data at certain time intervals.
           * **Period**: Select a copy interval from the list. The transfer will be run regularly at the specified interval. The first run will take place as soon as the settings are saved. If you run the transfer manually, it will be run after the specified interval next time.
           * **Cron expression**: Specify the copying schedule in [cron format](../../compute/concepts/snapshot-schedule.md#cron). All times are [UTC±00:00](https://en.wikipedia.org/wiki/UTC±00:00).
           * **Wait for transaction completion time, in seconds**: Specify the [delay](../concepts/regular-incremental-copy.md#increment-delay) for completing current transactions.
             * **Incremental tables**: Specify the tables whose data is copied incrementally, i.e., from where the copy process stopped previously; set values for the **Schema**, **Table**, **Key column**, and **Initial value** (optional) fields. For more information, see the [Periodic incremental backup](../concepts/regular-incremental-copy.md) section.
               
               {% note info %}
               
               This is more efficient than copying entire tables but less efficient than using transfers of the _**Snapshot and increment**_ type. This setting is available for PostgreSQL, ClickHouse®, and Airbyte® sources.
               
               {% endnote %}
             * **Snapshot settings** → **Parallel snapshot settings**: Specify the number of [workers](../concepts/index.md#worker) and threads per worker required for parallel copy processes.
               
               For more information on setting up workers and threads, see the [recommendations for parallel copying](../concepts/sharded.md#recommendations).
         * **Replication**: Allows you to receive data updates from the source and apply them to the target (without creating a full copy of the source data).
         * **Snapshot and increment**: Creates a full copy of the source data and keeps it up-to-date.
             * **Snapshot settings** → **Parallel snapshot settings**: Specify the number of [workers](../concepts/index.md#worker) and threads per worker required for parallel copy processes.
               
               For more information on setting up workers and threads, see the [recommendations for parallel copying](../concepts/sharded.md#recommendations).


     
     * For [billable](../pricing.md) source-target pairs at the [GA](../../overview/concepts/launch-stages.md) stage, you can configure the amount of computing resources per VM in the **Runtime environment** settings section.
     
         For the **Snapshot and increment** transfer type, runtime computing resources are selected separately for copying and for replication:
         
         The following computing resource configurations are available:

         * 2 vCPUs and 4 GB RAM. This is the default configuration.
         * 4 vCPUs and 8 GB RAM.
         * 8 vCPUs and 16 GB RAM.

         The VM resource configuration determines the performance of the data transfer [workers](../concepts/index.md#worker). A separate VM is allocated for each worker. For vCPU and RAM pricing policy, calculation examples, and cost optimization recommendations, see the [Pricing policy](../pricing.md) section.


     * **List of objects for transfer** (optional): Specify the full path to each object to transfer. Only objects from this list will be transferred. If you have listed included tables or collections in the source endpoint settings, only objects that are on both these lists will be transfered. If you specify objects not listed among included tables or collections in the source endpoint settings, transfer activation will end with the `$table not found in source` error. This setting is not available for such sources as Apache Kafka®, and YDS.

         Enter the full name of the object. Depending on the source type, use the appropriate naming convention:

         * ClickHouse®: `<database_name>.<table_path>`
         * Greenplum®: `<schema_name>.<table_path>`
         * MongoDB: `<database_name>.<collection_path>`
         * MySQL®: `<database_name>.<table_path>`
         * PostgreSQL: `<schema_name>.<table_path>`
         * YDB: table path
         * Oracle: `<schema_name>.<table_path>`

         If the specified object is on the excluded table or collection list in the source endpoint settings, or the object name was entered incorrectly, the transfer will end with an error. A running **Replication** or **Snapshot and increment** transfer will terminate immediately; an inactive one will terminate as soon as activated.

     * **Data transformation** (optional): [Data transformation](../concepts/data-transformation.md) rules. This setting only appears when the source and target are of different types.

        * [Renaming tables](../concepts/data-transformation.md#rename-tables)
        * [Column filter](../concepts/data-transformation.md#columns-filter)
        * [Data masking](../concepts/data-transformation.md#data-mask)
        * [Splitting tables into subtables](../concepts/data-transformation.md#subtable-splitting)
        * [Replacing primary keys](../concepts/data-transformation.md#replace-primary-key)
        * [Converting column values to strings](../concepts/data-transformation.md#convert-to-string)
        * [Sharding](../concepts/data-transformation.md#shard)
        * [String filter for APPEND-ONLY sources](../concepts/data-transformation.md#append-only-sources)


    1. Click **Create**.

- CLI {#cli}

    If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

    The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

    To create a transfer:

    1. View a description of the CLI create transfer command:

        ```bash
        yc datatransfer transfer create --help
        ```

    1. Specify the transfer parameters in the create command:

        ```bash
        yc datatransfer transfer create <transfer_name> \
           --source-id=<source_endpoint_ID> \
           --target-id=<target_endpoint_ID> \
           --type=<transfer_type>
        ```

        Where:

        * `--source-id`: Source endpoint ID.
        * `--target-id`: Target endpoint ID.
        * `--type`: [Transfer type](../concepts/transfer-lifecycle.md#transfer-types):
            * `snapshot-only`: [Copy](../concepts/transfer-lifecycle.md#copy).
            * `increment-only`: [Replicate](../concepts/transfer-lifecycle.md#replication).
            * `snapshot-and-increment`: [Copy and replicate](../concepts/transfer-lifecycle.md#copy-and-replication).

        {% note info %}

        The transfer name must be unique within the folder. It may contain Latin letters, numbers, and hyphens. The name may be up to 63 characters long.

        {% endnote %}

- Terraform {#tf}

    With [Terraform](https://www.terraform.io/), you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.
    
    Terraform is distributed under the [Business Source License](https://github.com/hashicorp/terraform/blob/main/LICENSE). The [Yandex Cloud provider for Terraform](https://github.com/yandex-cloud/terraform-provider-yandex) is distributed under the [MPL-2.0](https://www.mozilla.org/en-US/MPL/2.0/) license.
    
    For more information about the provider resources, see the relevant documentation on the [Terraform](https://www.terraform.io/docs/providers/yandex/index.html) website or [its mirror](../../terraform/index.md).

    If you do not have Terraform yet, [install it and configure the Yandex Cloud provider](../../tutorials/infrastructure-management/terraform-quickstart.md#install-terraform).
    
    
    To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), [authenticate](../../terraform/authentication.md) using the appropriate method.

    To create a transfer:

    1. Create a configuration file with a description of your transfer.

       Here is an example of the configuration file structure:

       ```hcl
       resource "yandex_datatransfer_transfer" "<transer_name_in_Terraform>" {
         folder_id   = "<folder_ID>"
         name        = "<transfer_name>"
         description = "<transfer_description>"
         source_id   = "<source_endpoint_ID>"
         target_id   = "<target_endpoint_ID>"
         type        = "<transfer_type>"
       }
       ```

       Where:
       
       * `type`: Transfer type. The possible values are:
         
         * `SNAPSHOT_ONLY`: Copying.
         * `INCREMENT_ONLY`: Replication.
         * `SNAPSHOT_AND_INCREMENT`: Copying and replication.

         The `INCREMENT_ONLY` and `SNAPSHOT_AND_INCREMENT` transfers will activate and run automatically upon creation.
       
       * To activate a `SNAPSHOT_ONLY` transfer once it is created:

         1. If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

             The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
       
         1. Add the `provisioner "local-exec"` section with the following transfer activation command to the configuration file:

             ```hcl
             provisioner "local-exec" {
               command = "yc --profile <profile> datatransfer transfer activate ${yandex_datatransfer_transfer.<transfer_Terraform_resource_name>.id}"
             }
             ```
         
             In this case, copying will only take place once at the time of transfer creation.

       * To specify runtime environment settings for a `SNAPSHOT_ONLY` transfer, add the `runtime` section to the resource description:

         ```hcl
         resource "yandex_datatransfer_transfer" "<transer_name_in_Terraform>" {
           ...
           runtime {
             yc_runtime {
               job_count = <number_of_workers>
               upload_shard_params {
                 job_count     = <number_of_workers>
                 process_count = <number_of_streams>
               }
             }
           }
           ...
         }
         ```

         Where:

         * `job_count`: Number of workers running in parallel.
         * `upload_shard_params`: Parallel copying settings.
           
           * `job_count`: Number of workers.
           * `process_count`: Number of threads within each worker.

       * To specify runtime environment settings for an `INCREMENT_ONLY` transfer, add the `replication_runtime` section to the resource description:

         ```hcl
         resource "yandex_datatransfer_transfer" "<transer_name_in_Terraform>" {
           ...
           replication_runtime {
             yc_runtime {
               job_count = <number_of_workers>
               upload_shard_params {
                 job_count     = <number_of_workers>
                 process_count = <number_of_streams>
               }
             }
           }
           ...
         }
         ```

       * To specify runtime environment settings for a `SNAPSHOT_AND_INCREMENT` transfer, add the `runtime` and `replication_runtime` sections to the resource description:
         
         ```hcl
         resource "yandex_datatransfer_transfer" "<transer_name_in_Terraform>" {
           ...
           runtime {
             yc_runtime {
               job_count = <number_of_workers>
               upload_shard_params {
                 job_count     = <number_of_workers>
                 process_count = <number_of_streams>
               }
             }
           }

           replication_runtime {
             yc_runtime {
               job_count = <number_of_workers>
               upload_shard_params {
                 job_count     = <number_of_workers>
                 process_count = <number_of_streams>
               }
             }
           }
           ...
         }
         ```

         Where:

         * `runtime`: Runtime environment settings for a copyng transfer.
         * `replication_runtime`: Runtime environment settings for a replication transfer.

    1. Make sure the settings are correct.

        1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
        1. Run this command:
        
           ```bash
           terraform validate
           ```
        
           Terraform will show any errors found in your configuration files.

    1. Confirm resource changes.

       1. Run this command to view the planned changes:
       
          ```bash
          terraform plan
          ```
       
          If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
       
       1. If everything looks correct, apply the changes:
          1. Run this command:
       
             ```bash
             terraform apply
             ```
       
          1. Confirm updating the resources.
          1. Wait for the operation to complete.

    For more information, see [this Terraform provider guide](../../terraform/resources/datatransfer_transfer.md).


- REST API {#api}

    Use the [Transfer.Create](../api-ref/Transfer/create.md) REST API method and provide the following in the request:

    * ID of the folder where the transfer should be placed, in the `folderId` parameter.
    * Transfer name in the `name` parameter.
    * Source endpoint ID in the `sourceId` parameter.
    * Target endpoint ID in the `targetId` parameter.
    * Transfer type in the `type` parameter. The possible values are:
      
      * `SNAPSHOT_ONLY`: Copying.
      * `INCREMENT_ONLY`: Replication.
      * `SNAPSHOT_AND_INCREMENT`: Copying and replication.

    * Runtime environment settings:
    
      * For the `SNAPSHOT_ONLY` transfer type, in the `runtime` object.
      * For the `INCREMENT_ONLY` transfer type, in the `replicationRuntime` object.
      * For the `SNAPSHOT_AND_INCREMENT` transfer type:
      
        * In the `runtime` object for copying.
        * In the `replicationRuntime` object for replication.

- gRPC API {#grpc-api}

    Use the [TransferService.Create](../api-ref/grpc/Transfer/create.md) gRPC API method and provide the following in the request:

    * ID of the folder where the transfer should be placed, in the `folder_id` parameter.
    * Transfer name in the `name` parameter.
    * Source endpoint ID in the `source_id` parameter.
    * Target endpoint ID in the `target_id` parameter.
    * Transfer type in the `type` parameter. The possible values are:
      
      * `SNAPSHOT_ONLY`: Copying.
      * `INCREMENT_ONLY`: Replication.
      * `SNAPSHOT_AND_INCREMENT`: Copying and replication.
    
    * Runtime environment settings:
    
      * For the `SNAPSHOT_ONLY` transfer type, in the `runtime` object.
      * For the `INCREMENT_ONLY` transfer type, in the `replication_runtime` object.
      * For the `SNAPSHOT_AND_INCREMENT` transfer type:
      
        * In the `runtime` object for copying.
        * In the `replication_runtime` object for replication.


{% endlist %}

## Updating a transfer {#update}

{% list tabs group=instructions %}

- Management console {#console}

    1. Open the [folder dashboard](https://console.yandex.cloud).
    1. Navigate to **Data Transfer**.
    1. In the left-hand panel, select ![image](../../_assets/console-icons/arrow-right-arrow-left.svg) **Transfers**.
    1. Select a transfer and click ![pencil](../../_assets/console-icons/pencil.svg) **Edit** in the top panel.
    1. Edit the transfer parameters:
        * **Name**.
        * **Description**.
        * For the **Snapshot** transfer type:

            * **Periodic snapshot**: Enable to create a full copy of your data at certain time intervals.
              * **Period**: Select a copy interval from the list. The transfer will be run regularly at the specified interval. The first run will take place as soon as the settings are saved. If you run the transfer manually, it will be run after the specified interval next time.
              * **Cron expression**: Specify the copying schedule in [cron format](../../compute/concepts/snapshot-schedule.md#cron). All times are [UTC±00:00](https://en.wikipedia.org/wiki/UTC±00:00).
              * **Wait for transaction completion time, in seconds**: Specify the [delay](../concepts/regular-incremental-copy.md#increment-delay) for completing current transactions.

            * **Incremental tables**: Specify the tables whose data is copied incrementally, i.e., from where the copy process stopped previously; set values for the **Schema**, **Table**, **Key column**, and **Initial value** (optional) fields. For more information, see the [Periodic incremental backup](../concepts/regular-incremental-copy.md) section.
              
              {% note info %}
              
              This is more efficient than copying entire tables but less efficient than using transfers of the _**Snapshot and increment**_ type. This setting is available for PostgreSQL, ClickHouse®, and Airbyte® sources.
              
              {% endnote %}

            * **Snapshot settings** → **Parallel snapshot settings**: Specify the number of [workers](../concepts/index.md#worker) and threads per worker required for parallel copy processes.
              
              For more information on setting up workers and threads, see the [recommendations for parallel copying](../concepts/sharded.md#recommendations).

        * For the **Snapshot and increment** transfer type: {#update-copy-repl}

            * **Snapshot settings** → **Parallel snapshot settings**: Specify the number of [workers](../concepts/index.md#worker) and threads per worker required for parallel copy processes.
              
              For more information on setting up workers and threads, see the [recommendations for parallel copying](../concepts/sharded.md#recommendations).


        
        * For [billable](../pricing.md) source-target pairs at the [GA](../../overview/concepts/launch-stages.md) stage, you can edit the amount of computing resources per VM in the **Runtime environment** settings section.
        
            For the **Snapshot and increment** transfer type, runtime computing resources are selected separately for copying and for replication:
        
            The following computing resource configurations are available:

            * 2 vCPUs and 4 GB RAM. This is the default configuration.
            * 4 vCPUs and 8 GB RAM.
            * 8 vCPUs and 16 GB RAM.

            The VM resource configuration determines the performance of the data transfer [workers](../concepts/index.md#worker). A separate VM is allocated for each worker. For vCPU and RAM pricing policy, calculation examples, and cost optimization recommendations, see the [Pricing policy](../pricing.md) section.


        * **List of objects for transfer**: Specify the full path to each object to transfer. Only objects from this list will be transferred. If you have listed included tables or collections in the source endpoint settings, only objects that are on both these lists will be transfered. If you specify objects not listed among included tables or collections in the source endpoint settings, transfer activation will end with the `$table not found in source` error. This setting is not available for such sources as Apache Kafka®, and YDS.

            Adding new objects to **Snapshot and increment** or **Replication** transfers in the **Replicating** status will result in uploading data history for these objects or tables. If a table is large, uploading the history may take a long time. You cannot edit the list of objects for transfers in the **Copying** status.

            Enter the full name of the object. Depending on the source type, use the appropriate naming convention:

            * ClickHouse®: `<database_name>.<table_path>`
            * Greenplum®: `<schema_name>.<table_path>`
            * MongoDB: `<database_name>.<collection_path>`
            * MySQL®: `<database_name>.<table_path>`
            * PostgreSQL: `<schema_name>.<table_path>`
            * YDB: table path
            * Oracle: `<schema_name>.<table_path>`

            If the specified object is on the excluded table or collection list in the source endpoint settings, or the object name was entered incorrectly, the transfer will end with an error. A running **Replication** or **Snapshot and increment** transfer will terminate immediately; an inactive one will terminate as soon as activated.

        * **Data transformation** (optional): [Data transformation](../concepts/data-transformation.md) rules. This setting only appears when the source and target are of different types.

           * [Renaming tables](../concepts/data-transformation.md#rename-tables)
           * [Column filter](../concepts/data-transformation.md#columns-filter)
           * [Data masking](../concepts/data-transformation.md#data-mask)
           * [Splitting tables into subtables](../concepts/data-transformation.md#subtable-splitting)
           * [Replacing primary keys](../concepts/data-transformation.md#replace-primary-key)
           * [Converting column values to strings](../concepts/data-transformation.md#convert-to-string)
           * [Sharding](../concepts/data-transformation.md#shard)
           * [String filter for APPEND-ONLY sources](../concepts/data-transformation.md#append-only-sources)


    1. Click **Save**.

- CLI {#cli}

    If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

    The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

    To update the transfer settings:

    1. View a description of the update transfer CLI command:

        ```bash
        yc datatransfer transfer update --help
        ```

    1. Run the following command with the list of settings you want to update:

        ```bash
        yc datatransfer transfer update <transfer_ID> \
           --name=<transfer_name> \
           --description=<transfer_description>
        ```

        You can get the transfer ID with the [list of transfers in the folder](#list).

- Terraform {#tf}

  1. Open the current Terraform configuration file with the transfer description.

      For information on creating a transfer like this, please review [Create transfer](#create).

  1. Edit the values in the `name` and the `description` fields (transfer name and description).
  1. Update the runtime environment settings:
      
      * For the `SNAPSHOT_ONLY` transfer type, in the `runtime` section.
      * For the `INCREMENT_ONLY` transfer type, in the `replication_runtime` section.
        
        If you have already specified the runtime environment settings under `runtime`, there is no need to add the `replication_runtime` section.

      * For the `SNAPSHOT_AND_INCREMENT` transfer type:
        
        * In the `runtime` section for copying.
        * In the `replication_runtime` section for replication.

        If only the `runtime` section is provided, the runtime environment settings for copying and replication will be identical.

  1. Make sure the settings are correct.

      1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
      1. Run this command:
      
         ```bash
         terraform validate
         ```
      
         Terraform will show any errors found in your configuration files.

  1. Confirm resource changes.

      1. Run this command to view the planned changes:
      
         ```bash
         terraform plan
         ```
      
         If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
      
      1. If everything looks correct, apply the changes:
         1. Run this command:
      
            ```bash
            terraform apply
            ```
      
         1. Confirm updating the resources.
         1. Wait for the operation to complete.

  For more information, see [this Terraform provider guide](../../terraform/resources/datatransfer_transfer.md).


- REST API {#api}

    Use the [Transfer.Update](../api-ref/Transfer/update.md) REST API method and provide the following in the request:

    * Transfer ID in the `transferId` parameter. To find out the ID, [get a list of transfers in the folder](#list).
    * Transfer name in the `name` parameter.
    * Transfer description in the `description` parameter.
    * Runtime environment settings:

      * For the `SNAPSHOT_ONLY` transfer type, in the `runtime` object.
      * For the `INCREMENT_ONLY` transfer type, in the `replicationRuntime` object.

        If you have already specified the runtime environment settings in the `runtime` object, there is no need to provide `replicationRuntime`.

      * For the `SNAPSHOT_AND_INCREMENT` transfer type:
      
        * In the `runtime` object for copying.
        * In the `replicationRuntime` object for replication.

        If only the `runtime` section is provided, the runtime environment settings for copying and replication will be identical.

    * List of transfer configuration fields to update in the `updateMask` parameter.

      {% note warning %}

      When you update a transfer, all parameters of the object you are modifying will be reset to their defaults unless explicitly provided in the request. To avoid this, list the settings you want to change in the `updateMask` parameter.

      {% endnote %}

- gRPC API {#grpc-api}
    
    Use the [TransferService.Update](../api-ref/grpc/Transfer/update.md) gRPC API method and provide the following in the request:

    * Transfer ID in the `transfer_id` parameter. To find out the ID, [get a list of transfers in the folder](#list).
    * Transfer name in the `name` parameter.
    * Transfer description in the `description` parameter.
    * Runtime environment settings:

      * For the `SNAPSHOT_ONLY` transfer type, in the `runtime` object.
      * For the `INCREMENT_ONLY` transfer type, in the `replication_runtime` object.

        If you have already specified the runtime environment settings in the `runtime` object, there is no need to provide `replication_runtime`.

      * For the `SNAPSHOT_AND_INCREMENT` transfer type:
      
        * In the `runtime` object for copying.
        * In the `replication_runtime` object for replication.

        If only the `runtime` section is provided, the runtime environment settings for copying and replication will be identical.

    * List of transfer configuration fields to update in the `update_mask` parameter.

      {% note warning %}

      When you update a transfer, all parameters of the object you are modifying will be reset to their defaults unless explicitly provided in the request. To avoid this, list the settings you want to change in the `update_mask` parameter.

      {% endnote %}


{% endlist %}

When updating a transfer, its settings are applied immediately. Editing **Snapshot and increment** or **Replication** transfer settings with the **Replicating** status will result in restarting the transfer.

## Activating a transfer {#activate}

{% list tabs group=instructions %}

- Management console {#console}

    1. Open the [folder dashboard](https://console.yandex.cloud).
    1. Navigate to **Data Transfer**.
    1. In the left-hand panel, select ![image](../../_assets/console-icons/arrow-right-arrow-left.svg) **Transfers**.
    1. Click ![ellipsis](../../_assets/console-icons/ellipsis.svg) next to the transfer name and select ![ellipsis](../../_assets/console-icons/play.svg) **Activate**.

- CLI {#cli}

    If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

    The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

    To activate a transfer, run this command:

    ```bash
    yc datatransfer transfer activate <transfer_ID>
    ```

    You can get the transfer ID with the [list of transfers in the folder](#list).


- API {#api}

    Use the [activate](../api-ref/Transfer/activate.md) API method and provide the transfer ID in the `transferId` request parameter.

    To find out the transfer ID, [get a list of transfers in the folder](#list).


{% endlist %}

{% note info %}

The operation is available in the Yandex Cloud [mobile app](https://yandex.cloud/en/mobile-app).

{% endnote %}

## Deactivating a transfer {#deactivate}

During transfer deactivation:

* The replication slot on the source is disabled.
* Temporary data transfer logs are deleted.
* The target is brought into the aligned state:
    * The data schema objects of the source are transferred for the final stage.
    * Indexes are created.

{% list tabs group=instructions %}

- Management console {#console}

    1. Switch the source to <q>read-only</q>.
    1. Open the [folder dashboard](https://console.yandex.cloud).
    1. Navigate to **Data Transfer**.
    1. In the left-hand panel, select ![image](../../_assets/console-icons/arrow-right-arrow-left.svg) **Transfers**.
    1. Click ![ellipsis](../../_assets/console-icons/ellipsis.svg) next to the transfer name and select **Deactivate**.
    1. Wait for the transfer status to change to **Stopped**.

- CLI {#cli}

    If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

    The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

    To deactivate a transfer, run this command:

    ```bash
    yc datatransfer transfer deactivate <transfer_ID>
    ```

    You can get the transfer ID with the [list of transfers in the folder](#list).


- API {#api}

    Use the [deactivate](../api-ref/Transfer/deactivate.md) API method and provide the transfer ID in the `transferId` request parameter.

    To find out the transfer ID, [get a list of transfers in the folder](#list).


{% endlist %}

{% note warning %}

Do not interrupt the deactivation of the transfer! If the process fails, the performance of the source and target is not guaranteed.

{% endnote %}

For more information, see [Transfer types and lifecycles](../concepts/transfer-lifecycle.md).


{% note info %}

The operation is available in the Yandex Cloud [mobile app](https://yandex.cloud/en/mobile-app).

{% endnote %}


## Deleting a transfer {#delete}

{% list tabs group=instructions %}

- Management console {#console}

    1. Open the [folder dashboard](https://console.yandex.cloud).
    1. Navigate to **Data Transfer**.
    1. In the left-hand panel, select ![image](../../_assets/console-icons/arrow-right-arrow-left.svg) **Transfers**.
    1. If the transfer you need is active, [deactivate it](#deactivate).
    1. Click ![ellipsis](../../_assets/console-icons/ellipsis.svg) next to the transfer name and select **Delete**.
    1. Click ![ellipsis](../../_assets/console-icons/trash-bin.svg) **Delete**.

- CLI {#cli}

    If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

    The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

    To delete a transfer, run this command:

    ```bash
    yc datatransfer transfer delete <transfer_ID>
    ```

    You can get the transfer ID with the [list of transfers in the folder](#list).

- Terraform {#tf}

    To delete a transfer created using Terraform:
    1. Open the current Terraform configuration file with the infrastructure plan.
    
       For more on how to create such a file, see [Creating a transfer](transfer.md#create).
    1. Delete the transfer description.
    1. Make sure the settings are correct.
    
       1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
       1. Run this command:
       
          ```bash
          terraform validate
          ```
       
          Terraform will show any errors found in your configuration files.
    
    1. Type `yes` and press **Enter**.
    
       1. Run this command to view the planned changes:
       
          ```bash
          terraform plan
          ```
       
          If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
       
       1. If everything looks correct, apply the changes:
          1. Run this command:
       
             ```bash
             terraform apply
             ```
       
          1. Confirm updating the resources.
          1. Wait for the operation to complete.
    
    For more information, see [this Terraform provider guide](../../terraform/resources/datatransfer_transfer.md).


- API {#api}

    Use the [delete](../api-ref/Transfer/delete.md) API method and provide the transfer ID in the `transferId` request parameter.

    To find out the transfer ID, [get a list of transfers in the folder](#list).


{% endlist %}



_Greenplum® and Greenplum Database® are registered trademarks or trademarks of Broadcom Inc. in the United States and/or other countries._

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