Update GitLab 8.16.6 to latest

Hello all,

I had to update the GitLab version running on a server to latest version. The installation version is 8.16.6 and the GitLab installed from source. Ideally, I want to remove current version (installed from source) and install a new one based on repositories.
I read on other topics that the database cannot be migrated to the latest version and I had to upgrade the step-by-step.

Can anyone help me with this? How can I make this upgrade?

Thank you in advance.