Specifically, from version 0.18.x to 28.x, which are 5-6 years apart.
Your legacy wallet should still be compatible with v28.1.
But not in v29.0 once it's released, you'll have to migrate it into a descriptor wallet.
For your UTXO Set and Blocks, the versions aren't too far apart and there's no incompatible changes listed in the
Release Notes.
To check it yourself: Meticulously read every release notes from v0.18.1 to v28.1, the part where it says: "
How to Upgrade" where forwards/backwards compatibility is usually mentioned.
But if you can backup the whole datadir (
since it's pruned anyways), do it in case something happens with during upgrade.