---
type: api
title: Upgrade all transforms
description: Transforms are compatible across minor versions and between supported major versions.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-transform-upgrade-transforms
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-transform-upgrade-transforms
products:
  - Elasticsearch
---

# Upgrade all transforms

Availability: Generally available since 7.16

## Paths

- `POST` `/_transform/_upgrade`

## Description

Transforms are compatible across minor versions and between supported major versions.
However, over time, the format of transform configuration information may change.
This API identifies transforms that have a legacy configuration format and upgrades them to the latest version.
It also cleans up the internal data structures that store the transform state and checkpoints.
The upgrade does not affect the source and destination indices.
The upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged.

If a transform upgrade step fails, the upgrade stops and an error is returned about the underlying issue.
Resolve the issue then re-run the process again.
A summary is returned when the upgrade is finished.

To ensure continuous transforms remain running during a major version upgrade of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade transforms before upgrading the cluster.
You may want to perform a recent cluster backup prior to the upgrade.

## Required authorization

- Cluster privileges: `manage_transform`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Query string parameters

- `dry_run` (boolean · default: false) — optional
  When true, the request checks for updates but does not run them.
- `timeout` (string · default: 30s) — optional
  Period to wait for a response. If no response is received before the timeout expires, the request fails and
returns an error.

## Response

`application/json`

- `needs_update` (number)
  The number of transforms that need to be upgraded.
- `no_action` (number)
  The number of transforms that don’t require upgrading.
- `updated` (number)
  The number of transforms that have been upgraded.
## Code examples

#### Console

```console
POST _transform/_upgrade
```

#### JavaScript

```javascript
const response = await client.transform.upgradeTransforms();
```

#### Python

```python
resp = client.transform.upgrade_transforms()
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_transform/_upgrade" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.transform().upgradeTransforms(u -> u);
```

#### C#

```c#
var response = await client.TransformManagement.UpgradeTransformsAsync();
```

#### PHP

```php
$resp = $client->transform()->upgradeTransforms();
```

#### Ruby

```ruby
response = client.transform.upgrade_transforms
```

## Response examples

#### Upgrade transform response example1

A successful response contains a summary when all transforms are upgraded.

```json
{
  "needs_update": 0,
  "updated": 2,
  "no_action": 1
}
```

