During firmware upgrade, the Upload Filesystem Image operation will erase all scripts stored in the ESP32's flash memory.

If you wish to preserve the saved scripts (plus keystore and run-on-start settings), the easier way to do so is to click on Download backup in the RBX IDE:

rbx backup 01 

This will create a TAR file that contains an archive of all the user-created content.

After the firmware has been upgraded, simply click on Restore backup:

rbx backup 02

Then select the TAR file that was previously downloaded and all the user content will be restored onto the Microcontroller Brick.