> ## 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 v3.1.1 (Local SGX)

> SKALE node upgrade steps from 3.1.0 to 3.1.1

<Warning>
  The firewall mechanism was updated in version 3.1.1. As a result, please proceed with the following steps with extra caution. Ensure that you perform these actions on each node individually.
</Warning>

## Upgrade steps for the node server

<Steps>
  1. Turn off sgxwallet
     ```bash theme={null}
     cd sgxwallet/run_sgx/ && docker-compose down && cd ../../
     ```

  2. Turn off the node

     ```bash theme={null}
     skale node turn-off --unsafe --yes
     ```

  3. Backup the node
     ```bash theme={null}
     skale node backup .
     ```
     Save the data on another machine

  4. Backup `sgx_data` folder and SGX backup key. Save the data on another machine

  5. Upgrade packages

     ```bash theme={null}
     sudo apt update && sudo apt upgrade
     sudo reboot
     ```

  6. Upgrade to Ubuntu 22.04
     ```bash theme={null}
     do-release-upgrade
     reboot
     ```

  7. Turn off docker-lvmpy
     ```bash theme={null}
     systemctl stop docker-lvmpy && systemctl disable docker-lvmpy
     ```

  8. Make sure nftables is installed
     ```bash theme={null}
     sudo apt update && sudo apt install nftables docker-compose-plugin
     ```

  9. Disable ufw ipv6 configuration
     ```bash theme={null}
     sed -i 's/IPV6=yes/IPV6=no/' /etc/default/ufw.
     ```

  10. Reload ufw
      ```bash theme={null}
      ufw reload
      ```

  11. Pull latest changes from sgxwallet
      ```bash theme={null}
      cd sgxwallet/run_sgx && git checkout stable && git pull
      ```

  12. Add `-b` option in the `command` section of `run_sgx/docker-compose.yml`

  13. Run sgxwallet
      ```bash theme={null}
      cd run_sgx && docker-compose up -d
      ```

  14. Download new node-cli binary

      ```bash theme={null}
      curl -L https://github.com/skalenetwork/node-cli/releases/download/2.6.0/skale-2.6.0-Linux-x86_64 > /usr/local/bin/skale
      ```

  15. Verify node-cli binary hash sum

      ```bash theme={null}
      sha512sum /usr/local/bin/skale
      ```

      Expected checksum

      ```bash theme={null}
      15b2aade24223da4f84ec79bd820d57f852fd7a5d78f10652823629da28aab5db49a5815a2be0c894bb00b99324b00b7d9da2ab1518ddc11f304378af54b427c
      ```

  16. Make node-cli executable
      ```bash theme={null}
      chmod +x /usr/local/bin/skale
      ```

  17. Update the following parameters to the new values
      ```bash theme={null}
      CONTAINER_CONFIGS_STREAM=3.1.1
      ```

  18. Execute update
      ```bash theme={null}
      skale node update .env --yes
      ```

  19. Restart nftables and docker services
        <Warning>
          Proceed with the execution in close collaboration with the core team, ensuring that the chains are fully stable beforehand.
        </Warning>
      ```bash theme={null}
      systemctl restart nftables && systemctl restart docker
      nft add rule inet firewall skale tcp dport 1026-1031 drop
      ```
</Steps>
