I will use the Foxgate S6224-S2 switch as an example.
We upload the firmware files to the tftp server and execute the following commands on the switch:
1) Copy the bootloader from the tftp server to the switch and reboot it.
copy tftp://192.168.1.5/FoxGate-S6224-S2(S4)-4.12.1_boot.rom boot.rom copy tftp://192.168.1.5/FoxGate-S6224-S2(S4)-4.12.1_config.rom config.rom reload
2) Copy the firmware file from the tftp server to the switch and reboot it again.
copy tftp://192.168.1.5/FoxGate-S6224-S2(S4)-18.104.22.168_nos.img nos.img reload
The switch should boot from the newly downloaded firmware. You can view its version by running on the switch:
Done, the switch settings after the firmware have not been changed.
See also my articles:
Starting a TFTP server in Windows
Installing and Configuring a TFTP Server in Ubuntu
FoxGate Switch Firmware Update via BootROM
FoxGate S6224-S4 Firmware Update