Gitlab backup and restore to another server with latest version

I am trying to migrate the entire repository from server A to Server B.

The current gitlab in server A is running in Version:7.7.2 , and Server B is running in Version:12.1.6-ee.

What is the best way to migrate the entire repositories from server A (Version:7.7.2)to server B(Version:12.1.6-ee).