How to migrate gitlab from non-packaged database to packaged database

I’m using gitlab 11.4.5-ee with non-packaged remote postgresql server(10.1.0). Now I want to migrate the current gitlab server into another server with packaged postgresql(9.6.8). I have done steps as below, but don’t know how to go further.

  1. Install gitlab 11.4.5-ee on new server.
  2. Install postgresql(10.10.2) into the legacy gitlab server and link psql and pg_dump to gitlab executable file.
  3. Backup the data on legacy server with command “gitlab-rake gitlab:backup:create STRATEGY=copy”
  4. scp the tar file to new server.
  5. scp the gitlab-secrets.json to new server