> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data transfer types and stop conditions

Data transfers are based on consecutive [iterations](https://docs.nebius.com/object-storage/transfer/overview.md#iterations). Each iteration passes the source and destination buckets once. You can configure the number of iterations and the interval between them. To do so:

* Specify the data transfer type if you [launch the data transfer](https://docs.nebius.com/object-storage/transfer/launch.md) in the web console.
* Set the stop condition if you launch the data transfer by using the CLI or other developer tools.

## Data transfer type (web console)

When you create a data transfer in the web console, you can select the *data transfer type*:

* **One-time transfer**: Data transfer is completed after just one iteration. One-time transfers are designed for data migration and backup.
* **Replication**: Iterations continue until you stop or delete the data transfer. Replications are designed for continuous synchronization between a source and a destination.

## Stop condition (developer tools)

When you use the CLI or other developer tools to create a data transfer, set a *stop condition* in the data transfer configuration. This condition specifies when the data transfer should stop.

The configuration must include exactly one of the following options:

* `.spec.after_one_iteration` (same as the **One-time transfer** type): Transfer stops after completing its first iteration. The value should be an empty object.

  > [tab] CLI
  >
  > ```json theme={null}
  > {
  >   "spec": {
  >     "after_one_iteration": {},
  >     // Other parameters
  >   }
  > }
  > ```

  > [tab] Terraform
  >
  > ```hcl theme={null}
  > resource "nebius_storage_v1_transfer" "one_time_transfer" {
  >   stop_condition {
  >     after_one_iteration = true
  >   }
  >   # Other parameters
  > }
  > ```

  > [tab] Go SDK
  >
  > ```go theme={null}
  > spec := &storage.TransferSpec{
  >     StopCondition: &storage.TransferSpec_AfterOneIteration{
  >         AfterOneIteration: &storage.TransferSpec_StopConditionAfterOneIteration{},
  >     },
  >     // Other parameters
  > }
  > ```

  > [tab] Python SDK
  >
  > ```python theme={null}
  > spec = TransferSpec(
  >     after_one_iteration=TransferSpec__StopConditionAfterOneIteration(),
  >     # Other parameters
  > )
  > ```

  > [tab] JavaScript SDK
  >
  > ```javascript theme={null}
  > const spec = TransferSpec.create({
  >   stopCondition: {
  >     $case: "afterOneIteration",
  >     afterOneIteration: TransferSpec_StopConditionAfterOneIteration.create(),
  >   },
  >   // Other parameters
  > });
  > ```

* `.spec.after_n_empty_iterations`: Transfer stops after a number of consecutive [empty iterations](https://docs.nebius.com/object-storage/transfer/overview.md#empty-iterations). For example, after five iterations:

  > [tab] CLI
  >
  > ```json theme={null}
  > {
  >   "spec": {
  >     "after_n_empty_iterations": {
  >       "empty_iterations_threshold": 5
  >     },
  >     // Other parameters
  >   }
  > }
  > ```

  > [tab] Terraform
  >
  > ```hcl theme={null}
  > resource "nebius_storage_v1_transfer" "empty_iterations_transfer" {
  >   stop_condition {
  >     after_n_empty_iterations {
  >       empty_iterations_threshold = 5
  >     }
  >   }
  >   # Other parameters
  > }
  > ```

  > [tab] Go SDK
  >
  > ```go theme={null}
  > spec := &storage.TransferSpec{
  >     StopCondition: &storage.TransferSpec_AfterNEmptyIterations{
  >         AfterNEmptyIterations: &storage.TransferSpec_StopConditionAfterNEmptyIterations{
  >             EmptyIterationsThreshold: 5,
  >         },
  >     },
  >     // Other parameters
  > }
  > ```

  > [tab] Python SDK
  >
  > ```python theme={null}
  > spec = TransferSpec(
  >     after_n_empty_iterations=TransferSpec__StopConditionAfterNEmptyIterations(
  >         empty_iterations_threshold=5,
  >     ),
  >     # Other parameters
  > )
  > ```

  > [tab] JavaScript SDK
  >
  > ```javascript theme={null}
  > const spec = TransferSpec.create({
  >   stopCondition: {
  >     $case: "afterNEmptyIterations",
  >     afterNEmptyIterations: TransferSpec_StopConditionAfterNEmptyIterations.create({
  >       emptyIterationsThreshold: 5,
  >     }),
  >   },
  >   // Other parameters
  > });
  > ```

* `.spec.infinite` (same as the **Replication** type): Transfer continues indefinitely until manually stopped.

  > [tab] CLI
  >
  > ```json theme={null}
  > {
  >   "spec": {
  >     "infinite": {},
  >     // Other parameters
  >   }
  > }
  > ```

  > [tab] Terraform
  >
  > ```hcl theme={null}
  > resource "nebius_storage_v1_transfer" "infinite_transfer" {
  >   stop_condition {
  >     infinite = true
  >   }
  >   # Other parameters
  > }
  > ```

  > [tab] Go SDK
  >
  > ```go theme={null}
  > spec := &storage.TransferSpec{
  >     StopCondition: &storage.TransferSpec_Infinite{
  >         Infinite: &storage.TransferSpec_StopConditionInfinite{},
  >     },
  >     // Other parameters
  > }
  > ```

  > [tab] Python SDK
  >
  > ```python theme={null}
  > spec = TransferSpec(
  >     infinite=TransferSpec__StopConditionInfinite(),
  >     # Other parameters
  > )
  > ```

  > [tab] JavaScript SDK
  >
  > ```javascript theme={null}
  > const spec = TransferSpec.create({
  >   stopCondition: {
  >     $case: "infinite",
  >     infinite: TransferSpec_StopConditionInfinite.create(),
  >   },
  >   // Other parameters
  > });
  > ```

## Interval between iterations

For data transfers with more than one iteration, you can optionally configure an interval between iterations:

> [tab] Web console
>
> In the [web console](https://console.nebius.com/datatransfer), this setting appears under **Interval between iterations** when you [create](https://docs.nebius.com/object-storage/transfer/launch.md) or [modify](https://docs.nebius.com/object-storage/transfer/manage.md) a data transfer.

> [tab] CLI
>
> ```json theme={null}
> {
>   "spec": {
>     "inter_iteration_interval": "<HhMmSs>"
>     // Other parameters
>   }
> }
> ```
>
> In the value, specify the number of hours, minutes, and seconds for the interval. For example, `1h20m40s`.

> [tab] Terraform
>
> ```hcl theme={null}
> resource "nebius_storage_v1_transfer" "example_transfer" {
>   inter_iteration_interval = "<HhMmSs>"
>   # Other parameters
> }
> ```
>
> In the value, specify the number of hours, minutes, and seconds for the interval. For example, `1h20m40s`.

> [tab] Go SDK
>
> Set `InterIterationInterval` to a Protocol Buffer duration. The example waits 1 hour, 20 minutes, and 40 seconds. `durationpb` is `google.golang.org/protobuf/types/known/durationpb`:
>
> ```go theme={null}
> interval := 1*time.Hour + 20*time.Minute + 40*time.Second
> spec := &storage.TransferSpec{
>     InterIterationInterval: durationpb.New(interval),
>     // Other parameters
> }
> ```

> [tab] Python SDK
>
> Set `inter_iteration_interval` to a `timedelta`. The example waits 1 hour, 20 minutes, and 40 seconds:
>
> ```python theme={null}
> from datetime import timedelta
>
> spec = TransferSpec(
>     inter_iteration_interval=timedelta(
>         hours=1,
>         minutes=20,
>         seconds=40,
>     ),
>     # Other parameters
> )
> ```

> [tab] JavaScript SDK
>
> Set `interIterationInterval` to a Day.js duration. The example waits 1 hour, 20 minutes, and 40 seconds:
>
> ```javascript theme={null}
> import dayjs from "dayjs";
> import duration from "dayjs/plugin/duration.js";
>
> dayjs.extend(duration);
> const spec = TransferSpec.create({
>   interIterationInterval: dayjs.duration({
>     hours: 1,
>     minutes: 20,
>     seconds: 40,
>   }),
>   // Other parameters
> });
> ```
