Hello,
Please forgive me but some of your terms are not logical.
...standalone base file...
seems to mean having Base with a non-embedded database. If so this can be done in many different ways (most of which involve servers). But it would be best guessed as a split database - database residing outside of the Base document. For that see this post →
[Wizard] Create a new ‘split’ HSQL 2.x database
Please note that this will use a newer database (still HSQLDB) than the embedded version and may cause some errors in SQL (queries) which will need modifications.
This is because the JRE was unticked to use with Ubuntu 11.0.11, or vice versa.
I believe you are referring to openjdk
of which I use v14.0.2 on Ubuntu 20.04.x
With various issues, it may be some problem(s) with your user profile. See → LibreOffice user profile
How can I prevent this happening again
There is no full prevention. Always something else which can go wrong. Best protection is having backups and not just on the same drive. With critical information, not even in same physical location.