---
title: Update an InfluxDB stack
description: Use the influx apply command to update a stack with a modified template. When applying a template to an existing stack, InfluxDB checks to see if the resources in the template match existing resources. InfluxDB updates, adds, and removes resources to resolve differences between the current state of the stack and the newly applied template.
url: https://docs.influxdata.com/influxdb/v2/tools/influxdb-templates/stacks/update/
estimated_tokens: 667
product: InfluxDB OSS v2
version: v2
---

# Update an InfluxDB stack

This page documents an earlier version of InfluxDB OSS. [InfluxDB 3 Core](/influxdb3/core/) is the latest stable version.

#### API token hashing is enabled by default in InfluxDB OSS 2.9.0

Stronger token security: tokens are stored as hashes on disk, so a copy of the database file doesn’t expose usable tokens. Existing tokens are hashed on first startup and the original strings can’t be recovered afterward — **capture any plaintext tokens you still need before you upgrade**.

For more information, see [Token hashing](/influxdb/v2/admin/tokens/#token-hashing).

Use the [`influx apply` command](/influxdb/v2/reference/cli/influx/apply/) to update a stack with a modified template. When applying a template to an existing stack, InfluxDB checks to see if the resources in the template match existing resources. InfluxDB updates, adds, and removes resources to resolve differences between the current state of the stack and the newly applied template.

Each stack is uniquely identified by a **stack ID**. For information about retrieving your stack ID, see [View stacks](/influxdb/v2/tools/influxdb-templates/stacks/view/).

**Provide the following:**

-   Organization name or ID
-   Stack ID
-   InfluxDB template URLs to apply

```sh
influx apply \
  -o example-org \
  -u http://example.com/template-1.yml \
  -u http://example.com/template-2.yml \
  --stack-id=12ab34cd56ef
```

Template resources are uniquely identified by their `metadata.name` field. If errors occur when applying changes to a stack, all applied changes are reversed and the stack is returned to its previous state.

#### Related

-   [influx apply](/influxdb/v2/reference/cli/influx/apply/)
-   [influx stacks update](/influxdb/v2/reference/cli/influx/stacks/update/)
