Another option… Years ago we tried something similar on Gradual upgrade 7.3 to version 7.4 - #2 by dnutan. Theoretically it should work (using centos vault repos and if needed elrepo archived repos or any other third-party repos having a repo archive/vault).
As always, if it were a working production system (despite its oldness) use a test environment first.
From that post you can grab some parts. Untested as of today (I just copy/pasted some excerpts of it but didn’t spend time reading it carefully or testing it again).
Note that there might be problems with EPEL repo (version numbering) or similar, for dependencies… Do a bit of research if needed.
Before updating all packages, keep in mind that nextcloud doesn’t like major versions upgrades. The old nethserver wiki still has some tricks for nextcloud upgrades.