Update galaxi s7 Edge to android version 8

Is it possible to update the Android version 7.1.2 on my galaxi s7 edge to, for example, android 8? This is because of an application that should run on at least version Android 8 in a few months?

Regain your privacy! Adopt /e/ the unGoogled mobile OS and online servicesphone

you are talking about upgrade, not update.

android 8 is already the base of the official Oreo dev build of /e/OS
you also can install unofficial Pie (android 9 based) or Q (android 10 based)
Discussion
for the s7edge
Downloads

.

as you already have TWRP installed, only point (8) is necessary for you.

… further detail https://doc.e.foundation/devices/hero2lte/install

Downloads for the hero2lte

To understand the difference between /e/OS builds check this guide

Just to be clear. I now have E/OS 7 and would like to go to E/OS 8, this process is clear.
However, I absolutely do not want to lose my data. How can I secure a backup of my data and restore it after upgrading to E/OS 8?
Which tool should I use? Unfortunately, I have no knowledge of the Android system.

Device tree will be different, so restoring a TWRP /Data partition (exclude device storage) backup could fail to restore your apps and data in-apps

There is a workaround :

.

In revanche, the content of your device storage (your files) is easy to copy to your computer and re-paste into the device after upgrading.

.