travis-ci.org to travis-ci.com migrator
travis-migrate is a tool that automatically migrates repositories or whole
accounts/organizations from travis-ci.org to travis-ci.com, while
trying to preserve as much data and settings as possible. It was built by the
Rust Infrastructure team to migrate all the repositories in our organizations.
In addition to the migration steps performed by Travis itself, the tool:
- Migrates all the cron jobs configured in the repository
- Migrates the required status checks in the repository's protected branches
You need Rust 1.31.0 or greater in order to use this tool. Made by Pietro Albini and released under the MIT license.
When the tool was written the Migration API was limited to beta testers. If you can't access it you need to contact Travis Support and ask them to enable it on the users/organizations you want to migrate.
API authentication keys
The tool needs the following API keys:
GITHUB_TOKEN: a personal access token of a GitHub account that has full admin access to all the repositoriesTRAVIS_TOKEN_ORG: thetravis-ci.orgAPI key of the account you want to use to perform the migrationTRAVIS_TOKEN_COM: thetravis-ci.comAPI key of the account you want to use to perform the migration
If you have the Travis CLI installed you can omit the Travis
environment variables, since the tool will call the CLI to fetch the tokens
automatically. Also note not all the subcommands require all the environment
variables to be present (listing repositories available to migrate only
requires TRAVIS_TOKEN_PRO).
Usage
You can list all the repositories that can be migrated in an account/organization with:
$ cargo run list rust-lang
You can migrate a single repository with:
$ cargo run migrate-repo rust-lang/rust
You can migrate all the repositories in an account/organization with:
$ cargo run migrate-account rust-lang
You can also exclude some repositories while migrating a whole account/organization:
$ cargo run migrate-account rust-lang --exclude rust-lang/rust --exclude rust-lang/cargo
Before you migrate you need to have the Travis CI GitHub app installed on your account, and you need to give it access to the repositories you want to migrate.