By default, the node’s database is at
$HOME/.avalanchego/db If you delete this directory, it will erase the state of your node, including private keys and keystore users.
If there is a new major release (e.g. Everest → Fuji), your node’s state will be reset. Otherwise, upgrading AvalancheGo will not overwrite or destroy your node’s state.
The only data not in this folder is your node’s Staking Key/Certificate. These are in
$HOME/.avalanchego/staking by default. If you delete this directory, it will erase your node ID. This will jeopardize your validator reward. If your node is a validator and you delete its staking key, it will no longer be a validator when it restarts.
Upgrading AvalancheGo will never erase or change your Staking Key/Certificate.