Migrating Multiple Repositories to GitHub Apps Guide

If your organization has more than 50 active repositories to migrate to our new GitHub Apps integration, you can use the travis_migrate_to_apps gem to migrate them in one sweep rather than having to add them manually one by one in the GitHub UI.

Here are the steps:

1. Install the gem

gem install travis_migrate_to_apps

2. Generate a GitHub personal access token with repo scope

You can generate a new GitHub token here.

Choose the name of your liking and ensure to select the whole repo scope as shown below:

GitHub new token page

Then click the “Generate token” button at the bottom to generate the token.

You’ll then be back on the GitHub token page:

GitHub token page

Take care of copying the newly generated token and save it for later usage.

Note: if you are migrating an organization, the token must be generated by an owner of the GitHub organization.

3. Activate the Travis CI GitHub Apps integration with 1 repo

Go to your profile page on Travis CI: https://travis-ci.com/profile

Click the “Activate GitHub Apps Integration” button highlighted below:

Activate GitHub Apps Integration button

You’ll directed to the GitHub Apps page for the Travis CI app:

GitHub Apps page

Choose at least one repository and click the “Approve & Install” button.

You’ll then be redirected to your profile page on Travis CI and the newly added repository should appear under “GitHub Apps Integration”:

Travis CI profile page

4. Get your Travis CI API token

Here are the two ways you can get this token:

  1. On your profile page: https://travis-ci.com/profile

Travis CI token on profile page

  1. Via the Travis CI client by running: travis token --pro

5. Run the gem

travis_migrate_to_apps [owner_name] [travis_access_token] [github_access_token]

where

  • [owner_name] is the GitHub account (user or organization) where the repositories you want to migrate are located
  • [travis_access_token] is the Travis CI token obtained in step #4 above
  • [github_access_token] is the GitHub token obtained in step #2 above

6. Check the migration result

You can now refresh your profile page on Travis CI and your newly migrated repositories should appear under the “GitHub Apps Integration” section.