ESP8266 OTA update with different flash size settings?
The basic problem is that when you upload over OTA you don't upload the partition structure.
The ESP32's flash is split into a number of &quot;partitions&quot; or areas.  It might look something like:
+----+-+-------------+-------------+---------------------+
|BOOT|P|OTA Program 1|OTA Program 2| SPIFFS              |
+----+-+-------------+-------------+---------------------+

When you upload over UART you upload all that structure, and that structure can be changed.  When you upload over OTA you only upload one of &quot;OTA Program 1&quot; or &quot;OTA Program 2&quot;. One of those is active and the other is inactive. You upload to the inactive one and then at the next reboot that becomes the active one. This allows the system to confirm that the program has been written correctly before running it to reduce the chances of bricking a device in the field.
Because of this you can never upload anything that doesn't fit into one of the OTA program partitions.
One risky option which you would have to do thorough local testing of first, is to write a program which, when executed, will change the partitioning. You would have to make sure that it runs in the lower OTA partition so that the inactive one is the one that gets both moved and expanded, which may take a little trial and error.
Once that has happened you should be able to upload a larger OTA program into the new, bigger, inactive OTA segment.
But that's only supposition and it's not something I have ever done or heard of anyone doing.