From your mention of Oracle Linux I assume you are using cloud hosting. Which implies your new version on a different OS will be on a different virtual machine.
If that is the case the only real option you have is logical replication. If you can't afford to have downtime and your database is being written to constantly, copying 5TB of data is going to take too long.
You should be able to use the built-in logical replication I think. It was available in PostgreSQL 13 although there have been a lot of changes since then. If not, check out the pglogical extension from 2nd quadrant.
I would recommend taking the time to set up a proper test environment with a copy of your production system, but much smaller. Start with 5MB of data, then go through 50MB and 500MB - get a feeling for how the logical replication setup works. That should give you an estimate for how long the process will take too.
Add in scripts to check a couple of frequently-updated tables to make sure your new DB is completely up-to-date. If you can automate preventing writes to your old DB, and switching traffic to the new one, add that to your test setup too.
The key things that might trip you up are differences in installed extension versions (postgis etc) or in locale settings/libraries or timezones. Make sure your smaller test-data can exercise those corners.