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

# Extend a deployed contract's storage entry TTL

> Use the CLI to extend the time to live (TTL) of a contract's persistent storage entry

You can use the Stellar CLI to extend the TTL of a contract's persistent storage entry. For a storage entry that uses a simple `Symbol` as its storage key, you can run a command like so:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
stellar contract extend \
    --source S... \
    --network testnet \
    --id C... \
    --key COUNTER \
    --ledgers-to-extend 535679 \
    --durability persistent
```

This example uses 535,679 ledgers as the new archival TTL. This is the maximum allowable value for this argument on the CLI. This corresponds to roughly 30 days (averaging 5 second ledger close times).

If your storage entry uses a more advanced storage key, such as `Balance(Address)` in a token contract, you'll need to provide the key in a base64-encoded XDR form:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
stellar contract extend \
    --source S... \
    --network testnet \
    --id C... \
    --key-xdr AAAABgAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAAA4AAAAHQmFsYW5jZQAAAAAB \
    --ledgers-to-extend 535679 \
    --durability persistent
```

> [!NOTE]
>
> Be sure to check out our [guide on creating XDR ledger keys](https://developers.stellar.org/docs/build/guides/rpc/generate-ledger-keys-python.md) for help generating them.
