Migrate to TeamCity
Quick Start
teamcity migrate # detect + convert + write .tc.yml files
teamcity migrate --dry-run --json # preview as structured JSON
teamcity pipeline validate f.tc.yml # schema check
teamcity project vcs create --url <repo-url> --auth anonymous -p ProjectId # create VCS root first
teamcity pipeline create name -p ProjectId -f f.tc.yml --vcs-root <VcsRootId>
teamcity run start PipelineId --watch
Run teamcity migrate from the repo root -- detection scans .github/workflows/ and bamboo-specs/ relative to the current directory.
Reading the report
- Needs review -- problems inside the generated YAML: TODO stubs, dropped steps, reusable-workflow placeholders. Fix these in the file before creating the pipeline.
- Manual setup needed -- work the converter cannot do. Sort each item onto one of two sides: YAML edits (secrets, matrix expansion, expression
runs-on, container:/services:) go before pipeline create; server-side configuration (connections, if:-derived branch filters, triggers, notifications) comes after. The checklist below orders them.
- Exit code 1 means at least one source failed to convert or one generated file failed schema validation -- files that converted cleanly are still written. Read the per-file ✓/⚠/✗ lines instead of treating exit 1 as total failure.
--json prints {"sources": [...], "results": [...]} to stdout; each result carries outputFile, yaml, needsReview, manualSetup, and validationError.
Gotchas
- Always
type: script for ./gradlew and ./mvnw. TC's type: gradle/type: maven runners use the agent's version, not the project's. This causes real build failures.
- Schema valid does not mean pipeline works. Migration is not done until builds pass.
- Private repos: use a GitHub App connection, not a PAT. Start with
teamcity project connection create github-app -p <project> -- its output prints the authorize, App-install, and vcs create follow-up commands. That flow opens a browser; in headless runs pass existing App credentials (--no-manifest --app-id <id> --client-id <id> --private-key-file <pem> --stdin, client secret piped to stdin) or use SSH deploy keys (teamcity project ssh upload with a git@github.com: URL). Public repos: --auth anonymous.
- Secrets, triggers, and branch filters are always manual. The converter flags them but cannot create them -- the checklist below covers each.
- VCS root must exist before pipeline create.
teamcity pipeline create takes --vcs-root <id>, not a URL. Create it first with teamcity project vcs create.
- Default branch defaults to
main. Pass --branch refs/heads/master to teamcity project vcs create if the repo uses master.
- Unknown actions/tasks become stubs. Read the action's source, write an equivalent shell script. Most actions are thin CLI wrappers. See mappings.
Workflow
Goal: get all pipeline jobs green on the TC server, not just generate valid YAML.
Copy this checklist and check off items as you complete them:
Migration progress:
- [ ] Convert: run `teamcity migrate` from the repo root
- [ ] Fix every "Needs review" item, plus "Manual setup" items needing YAML edits (matrix expansion, expression `runs-on`, container/services) -- see mappings.md and gotchas.md
- [ ] Wire up secrets in the YAML: the converter rewrites `${{ secrets.X }}` to `%X%` but does not define it -- store the value (`teamcity project token put <project> <value>`) and add `X: "credentialsJSON:<uuid>"` under the top-level `secrets:` block (see schema.md)
- [ ] Validate: `teamcity pipeline validate <file>` -- only proceed when it passes
- [ ] Create VCS root (`teamcity project vcs create`), then `teamcity pipeline create <name> -p <project> -f <file> --vcs-root <id>`
- [ ] Set up the remaining runtime "Manual setup needed" items before running: registry/cloud connections the steps reference (the first run fails without them), and any `if:`-condition items -- gate converted deploy/release steps via branch filter, execution condition, or a guard in the script so the first run cannot deploy from the wrong branch
- [ ] Run: `teamcity run start <id> --watch`; on failure read `teamcity run log <id> --failed --raw`, fix, `teamcity pipeline push`, re-run until green
- [ ] Do the trigger-only "Manual setup needed" items: triggers, notifications
- [ ] Report: what migrated and what remains manual
References
- Mappings -- GitHub Actions and Bamboo to TeamCity translation tables
- Schema -- TC pipeline YAML quick reference
- Gotchas -- skip list, matrix expansion, troubleshooting, manual setup items
1---2name: migrate-to-teamcity3description: Migrating CI/CD pipelines to TeamCity. Use when the user wants to migrate, convert, or switch to TeamCity from GitHub Actions (.github/workflows/) or Bamboo (bamboo-specs/*.yml), even if they only say "move our CI". Other CI systems (GitLab, Jenkins, CircleCI, Azure DevOps, Travis, Bitbucket) are not supported yet.4---5
6# Migrate to TeamCity
7
8## Quick Start
9
10```bash
11teamcity migrate # detect + convert + write .tc.yml files
12teamcity migrate --dry-run --json # preview as structured JSON
13teamcity pipeline validate f.tc.yml # schema check
14teamcity project vcs create --url <repo-url> --auth anonymous -p ProjectId # create VCS root first
15teamcity pipeline create name -p ProjectId -f f.tc.yml --vcs-root <VcsRootId>
16teamcity run start PipelineId --watch
17```
18
19Run `teamcity migrate` from the repo root -- detection scans `.github/workflows/` and `bamboo-specs/` relative to the current directory.
20
21## Reading the report
22
23- **Needs review** -- problems inside the generated YAML: TODO stubs, dropped steps, reusable-workflow placeholders. Fix these in the file before creating the pipeline.
24- **Manual setup needed** -- work the converter cannot do. Sort each item onto one of two sides: YAML edits (secrets, matrix expansion, expression `runs-on`, `container:`/`services:`) go before `pipeline create`; server-side configuration (connections, `if:`-derived branch filters, triggers, notifications) comes after. The checklist below orders them.
25- Exit code 1 means at least one source failed to convert *or* one generated file failed schema validation -- files that converted cleanly are still written. Read the per-file ✓/⚠/✗ lines instead of treating exit 1 as total failure.
26- `--json` prints `{"sources": [...], "results": [...]}` to stdout; each result carries `outputFile`, `yaml`, `needsReview`, `manualSetup`, and `validationError`.
27
28## Gotchas
29
30- **Always `type: script` for `./gradlew` and `./mvnw`.** TC's `type: gradle`/`type: maven` runners use the agent's version, not the project's. This causes real build failures.
31- **Schema valid does not mean pipeline works.** Migration is not done until builds pass.
32- **Private repos: use a GitHub App connection, not a PAT.** Start with `teamcity project connection create github-app -p <project>` -- its output prints the authorize, App-install, and `vcs create` follow-up commands. That flow opens a browser; in headless runs pass existing App credentials (`--no-manifest --app-id <id> --client-id <id> --private-key-file <pem> --stdin`, client secret piped to stdin) or use SSH deploy keys (`teamcity project ssh upload` with a `git@github.com:` URL). Public repos: `--auth anonymous`.
33- **Secrets, triggers, and branch filters are always manual.** The converter flags them but cannot create them -- the checklist below covers each.
34- **VCS root must exist before pipeline create.** `teamcity pipeline create` takes `--vcs-root <id>`, not a URL. Create it first with `teamcity project vcs create`.
35- **Default branch defaults to `main`.** Pass `--branch refs/heads/master` to `teamcity project vcs create` if the repo uses `master`.
36- **Unknown actions/tasks become stubs.** Read the action's source, write an equivalent shell script. Most actions are thin CLI wrappers. See [mappings](references/mappings.md).
37
38## Workflow
39
40Goal: get all pipeline jobs green on the TC server, not just generate valid YAML.
41
42Copy this checklist and check off items as you complete them:
43
44```
45Migration progress:
46- [ ] Convert: run `teamcity migrate` from the repo root
47- [ ] Fix every "Needs review" item, plus "Manual setup" items needing YAML edits (matrix expansion, expression `runs-on`, container/services) -- see mappings.md and gotchas.md
48- [ ] Wire up secrets in the YAML: the converter rewrites `${{ secrets.X }}` to `%X%` but does not define it -- store the value (`teamcity project token put <project> <value>`) and add `X: "credentialsJSON:<uuid>"` under the top-level `secrets:` block (see schema.md)
49- [ ] Validate: `teamcity pipeline validate <file>` -- only proceed when it passes
50- [ ] Create VCS root (`teamcity project vcs create`), then `teamcity pipeline create <name> -p <project> -f <file> --vcs-root <id>`
51- [ ] Set up the remaining runtime "Manual setup needed" items before running: registry/cloud connections the steps reference (the first run fails without them), and any `if:`-condition items -- gate converted deploy/release steps via branch filter, execution condition, or a guard in the script so the first run cannot deploy from the wrong branch
52- [ ] Run: `teamcity run start <id> --watch`; on failure read `teamcity run log <id> --failed --raw`, fix, `teamcity pipeline push`, re-run until green
53- [ ] Do the trigger-only "Manual setup needed" items: triggers, notifications
54- [ ] Report: what migrated and what remains manual
55```
56
57## References
58
59- [Mappings](references/mappings.md) -- GitHub Actions and Bamboo to TeamCity translation tables
60- [Schema](references/schema.md) -- TC pipeline YAML quick reference
61- [Gotchas](references/gotchas.md) -- skip list, matrix expansion, troubleshooting, manual setup items