In order to migrate from hosted GitLab to GitHub, I decided to use command-line git to mirror each repository from within the GitLab storage on our server.
The script uses the GitHub API to create a new private repository, and then uses the git command-line tool to mirror the repository.
The script keeps track of which repositories have been migrated by creating hidden .migrated-github-<repository>
files. If you run the script again, these repositories will be skipped. This means you can re-run the script to recover from errors, such as a repository containing a file larger than 100MB (see https://rtyley.github.io/bfg-repo-cleaner/ for a solution to that).
If you choose to remove those files, you can still run the script multiple times as it mirrors the repository to GitHub. This approach could be used to pick up any changes made in GitLab before the final changeover to GitHub. But see the next paragraph...