Skip to content

Migrate from Forgejo

Codebahn is built on Forgejo, so this is the closest migration. Code, issues, pull requests, labels, milestones, and releases carry over through the web UI or the codebahn CLI. Your workflow files come across with your git history and run on Codebahn’s hosted EU runners.

  • A Codebahn account with an organization (see getting started)
  • An access token on your source Forgejo or Gitea instance (see below)
  • Git installed locally

On your source instance, go to Settings > Applications and generate a token with:

PermissionLevel
repositoryRead
issueRead

The repository scope covers files, pull requests, and releases. The issue scope covers issues, labels, and milestones. You need both for a full import. On Forgejo v15.0+, you can scope the token to specific repositories. Copy the token value; it is shown once.

  1. In Codebahn, click + > Import repository > Forgejo

  2. In Clone URL, paste the HTTPS URL of your repository (https://your-instance.org/your-org/your-repo.git)

  3. Paste your access token

  4. Select what to import: issues, pull requests, labels, milestones, releases

  5. Choose your org as the owner, confirm the name, and click Migrate repository

This is a one-time import. The Codebahn repository is independent of your source instance afterward. The import does not carry over teams or permissions; re-create access control on the Codebahn side. For the field-by-field migration options, see the upstream Forgejo docs.

Point your local clone at Codebahn:

Terminal window
git remote set-url origin git@codebahn.net:your-org/your-repo.git

The codebahn CLI can import from any Forgejo or Gitea instance. Install the CLI first. Pass the access token with --source-token.

Terminal window
codebahn repo import your-instance.org/your-org/your-repo --source-token $FORGEJO_TOKEN

By default, the CLI imports issues, pull requests, labels, milestones, and releases. To skip specific metadata:

Terminal window
codebahn repo import your-instance.org/your-org/your-repo --source-token $FORGEJO_TOKEN --no-issues --no-prs
Terminal window
codebahn repo import your-instance.org/your-org --owner my-codebahn-org --source-token $FORGEJO_TOKEN -y

Use --include and --exclude with glob patterns to select repos.

Your workflows carry over with your git history and should run unchanged. Codebahn scans .forgejo/workflows/, .github/workflows/, .codebahn/workflows/, and .gitea/workflows/; see Workflow directories for precedence.

Hosted runners answer to ubuntu-latest (alias for codebahn-small), codebahn-medium, and codebahn-large. If a workflow targets a custom runner label, register a BYO runner with that label or change runs-on.

Codebahn cancels in-progress runs when you push a new commit to the same branch (this is the default, unlike GitHub). To let every run finish, override it:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

See Set up CI for runner specs, minute counting, and the toolchains pre-cached in the job image.

CLI: import an entire org in one command. See Import with the CLI above.

Web UI: run one migration per repository with the org as the owner.

API: script it against the migration API.

Invite your team to the org with a team invite after the repos are in.

“Authentication failed” or 401. The token is expired or missing repository read. Generate a new one.

“Not found” or 404. The token can’t access this repository. If you scoped it to specific repos, confirm this one is in the list.

Issues or pull requests missing. The token needs issue read. Create a token with both scopes and re-run the migration.

If the import does not fit your situation, clone and push by hand:

Terminal window
git clone --bare https://your-instance.org/your-org/your-repo.git
cd your-repo.git
git push --mirror git@codebahn.net:your-org/your-repo.git

This moves code and branches only. Issues, pull requests, and releases are not included.

You are never locked in. From Org Settings > Export you can pull a tar.gz of every repo plus its issues, pull requests, labels, milestones, and releases, any time. See Export your data for what’s in the archive and how to restore it.