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

# Migration guides

> Upgrade between Anchor versions

This guide helps you migrate between major Anchor versions.

## Migrating to 0.32.0

### IDL upload by default

`anchor deploy` now uploads IDL automatically:

```bash theme={null}
# To skip IDL upload
anchor deploy --no-idl
```

### solana-verify integration

`anchor verify` has been replaced:

```bash theme={null}
# Old
anchor verify <PROGRAM_ID>

# New (uses solana-verify)
anchor verify <PROGRAM_ID>  # Works the same, but uses solana-verify under the hood
```

### Program type changes

Generic `Program<'info>` now validates executable-only:

```rust theme={null}
// Before: required specific program type
pub system_program: Program<'info, System>

// After: can use generic for any program
pub any_program: Program<'info>
```

## Migrating to 0.31.0

### Dynamic discriminators

Discriminators are no longer always 8 bytes:

```rust theme={null}
// Use discriminator methods instead of hardcoding
let discriminator = MyAccount::discriminator();
```

### LazyAccount

For large accounts, use `LazyAccount` to defer deserialization:

```rust theme={null}
// Before
#[account(mut)]
pub large_account: Account<'info, LargeData>

// After (for better performance)
#[account(mut)]
pub large_account: LazyAccount<'info, LargeData>
```

## Migrating to 0.30.0

### Token-2022 support

Use interface types for Token-2022 compatibility:

```rust theme={null}
// Before
use anchor_spl::token::{TokenAccount, Token};

#[account(mut)]
pub token_account: Account<'info, TokenAccount>
pub token_program: Program<'info, Token>

// After
use anchor_spl::token_interface::{TokenAccount, TokenInterface};

#[account(mut)]
pub token_account: InterfaceAccount<'info, TokenAccount>
pub token_program: Interface<'info, TokenInterface>
```

## Migrating from 0.29.0

### Solana 1.18+ compatibility

Update your `Anchor.toml`:

```toml theme={null}
[toolchain]
solana_version = "1.18.0"
```

### Account resolution

Use IDL-based account resolution:

```typescript theme={null}
// Automatic account resolution from IDL
await program.methods
  .myInstruction()
  .accounts({
    // Only required accounts need to be specified
    user: user.publicKey,
  })
  .rpc();
```

## General upgrade process

1. **Update Anchor CLI**:
   ```bash theme={null}
   avm install latest
   avm use latest
   ```

2. **Update dependencies** in `Cargo.toml`:
   ```toml theme={null}
   [dependencies]
   anchor-lang = "0.32.0"
   anchor-spl = "0.32.0"
   ```

3. **Update `Anchor.toml`** if needed

4. **Run tests**:
   ```bash theme={null}
   anchor test
   ```

5. **Fix any breaking changes** based on compiler errors

## Version compatibility

| Anchor | Solana | Rust  |
| ------ | ------ | ----- |
| 0.32.x | 2.0+   | 1.75+ |
| 0.31.x | 1.18+  | 1.75+ |
| 0.30.x | 1.17+  | 1.70+ |
| 0.29.x | 1.16+  | 1.70+ |

## Need help?

<CardGroup cols={2}>
  <Card title="Changelog" icon="clock" href="/resources/changelog">
    Review detailed changes
  </Card>

  <Card title="Discord" icon="discord" href="https://discord.gg/NHHGSXAnXk">
    Ask the community
  </Card>
</CardGroup>
