If a live or persistent live system
@C.S.Cameron's comments are relevant.
Save the casper-rw file or the content of the casper-rw partition.
The method he is describing is explained with more details at the following link,
If you want a persistent live system with a casper-rw partition, you can use mkusb to create it from the same Ubuntu iso file as the previous one. Then the content of the old casper-rw partition will work.
If an installed system (installed like into an internal drive)
It is possible to convert the boot mode from BIOS (alias legacy) mode to UEFI according to this link (as suggested by @MichaelBay in the comment to your question),
Which commands to convert a Ubuntu BIOS install to EFI/UEFI without boot-repair on single boot hardware?
An alternative (for other users, who read this in the future) is to create an installed system (or modify your current system) such that it can boot both in UEFI mode and BIOS mode. See the following link,
This way you make a system, that is portable between newer and older computers.