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

# Upgrade to v5.0.0

> SKALE node upgrade steps from 4.0.1 to 5.0.0

<Note>
  Before beginning the upgrade, create and store backups on another machine:

  * Back up the SGXWallet `sgx_data` directory and `sgx_wallet_backup_key.txt`.
  * Back up the node:

    ```bash theme={null}
    skale node backup .
    ```
</Note>

## Upgrade steps for the SGX server

<Steps>
  <Step title="Confirm the SGXWallet backup">
    Confirm that the SGXWallet `sgx_data` directory and backup key are backed up.
  </Step>

  <Step title="Open the SGXWallet configuration directory">
    ```bash theme={null}
    cd sgxwallet/run_sgx
    ```
  </Step>

  <Step title="Set the SGXWallet image">
    In `docker-compose.yml`, set the SGXWallet image to `skalenetwork/sgxwallet_release:1.10.2`.
  </Step>

  <Step title="Restart the SGXWallet container">
    ```bash theme={null}
    docker compose down && docker compose pull && docker compose up -d
    ```
  </Step>
</Steps>

## Upgrade steps for the node server

<Steps>
  <Step title="Stop docker-lvmpy">
    ```bash theme={null}
    systemctl stop docker-lvmpy
    ```
  </Step>

  <Step title="Download node-cli v3.2.0">
    ```bash theme={null}
    curl -L https://github.com/skalenetwork/node-cli/releases/download/3.2.0/skale-3.2.0-Linux-x86_64 > /usr/local/bin/skale
    ```
  </Step>

  <Step title="Verify the node-cli binary checksum">
    ```bash theme={null}
    sha512sum /usr/local/bin/skale
    ```

    Expected checksum:

    ```text theme={null}
    ccc2ae7a8694d75ed3f4cbc1d36dbfc4b55561fc41daecd30b52c97da6e122164333719b432fe246bc89f47737d743c2cf33b0f718070d4658789af817ee52d0
    ```
  </Step>

  <Step title="Make node-cli executable">
    ```bash theme={null}
    chmod +x /usr/local/bin/skale
    ```
  </Step>

  <Step title="Replace legacy .env options">
    Replace each legacy option with its new option; do not keep both names in `.env`.

    | Legacy option               | New option             |
    | --------------------------- | ---------------------- |
    | `DISK_MOUNTPOINT`           | `BLOCK_DEVICE`         |
    | `DOCKER_LVMPY_STREAM`       | `DOCKER_LVMPY_VERSION` |
    | `CONTAINER_CONFIGS_STREAM`  | `NODE_VERSION`         |
    | `MANAGER_CONTRACTS_ABI_URL` | `MANAGER_CONTRACTS`    |
    | `IMA_CONTRACTS_ABI_URL`     | `IMA_CONTRACTS`        |
    | `SGX_SERVER_URL`            | `SGX_URL`              |
  </Step>

  <Step title="Remove obsolete .env options">
    Remove these obsolete options from `.env`:

    * `DB_PORT`
    * `DB_ROOT_PASSWORD`
    * `DB_PASSWORD`
    * `DB_USER`
    * `IMA_ENDPOINT`
    * `DISABLE_IMA`
    * `TELEGRAF`
  </Step>

  <Step title="Set updated .env options">
    Set `NODE_VERSION` to `5.0.0`, `MANAGER_CONTRACTS` and `IMA_CONTRACTS` to `production` and update `FILEBEAT_HOST`:

    ```bash theme={null}
    NODE_VERSION=5.0.0
    MANAGER_CONTRACTS=production
    IMA_CONTRACTS=production
    FILEBEAT_HOST="mainnet-elk.skalenodes.com:5000"
    ```
  </Step>

  <Step title="Run the update procedure">
    ```bash theme={null}
    skale node update .env --yes
    ```
  </Step>
</Steps>
