Migrate a repository in
migrate_repoCopy a repository from another forge or Forgejo instance into this one, including issues, pull requests, labels, milestones, releases, and wiki, to move project data beyond git refs.
Instructions
Migrate (copy) a repository from ANOTHER forge/instance into this one — the only way to move issues and PRs across instances, unlike push mirrors which carry git refs only. Give clone_addr (http/https URL on the source) and repo_name. Set service to the source forge ("gitea" for Forgejo; the default "git" copies refs only) and turn on issues/pull_requests/labels/milestones/releases/wiki, which all default to false. The import runs within the call, which answers with the finished repository (seconds for a small one). A failure can leave an empty repository under repo_name; the error says so, and it must be deleted before retrying under that name. This copies — the source repo is left untouched. Requires write mode. For a private source, the credential comes from the server's FORGEJO_MIGRATE_TOKEN env var — never pass it as an argument. Set authenticate=true to send it; auth_username is only for service git (optional), onedev and codebase, and is refused for gitea, github, gitlab, gogs and gitbucket, whose importers ignore the token when given a username.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lfs | No | Also fetch Git LFS objects. Defaults to false. | |
| wiki | No | Also migrate the wiki. Defaults to false. | |
| issues | No | Also migrate issues. Requires a non-`git` `service`. Defaults to false. | |
| labels | No | Also migrate labels. Requires a non-`git` `service`. Defaults to false. | |
| mirror | No | Keep the new repo as a *pull* mirror that periodically re-fetches from the source, instead of taking a one-shot copy. Defaults to false. | |
| private | No | Visibility of the new repository. Defaults to private. | |
| service | No | Source forge type: `git`, `github`, `gitea` (use this for Forgejo), `gitlab`, `gogs`, `onedev`, `gitbucket`, `codebase`. Defaults to `git`, which copies git refs only — name the real forge to carry issues, PRs and releases across. | |
| releases | No | Also migrate releases (and their attachments). Requires a non-`git` `service`. Defaults to false. | |
| repo_name | Yes | Name for the new repository on this instance. | |
| clone_addr | Yes | Source clone URL on the *other* instance, e.g. `https://codeberg.org/owner/repo.git`. Must be `http://` or `https://`. | |
| milestones | No | Also migrate milestones. Requires a non-`git` `service`. Defaults to false. | |
| repo_owner | No | User or organisation that will own the new repo. Defaults to the authenticated user. | |
| description | No | Description for the new repository. | |
| authenticate | No | Send the server's `FORGEJO_MIGRATE_TOKEN` as the source credential: as a token for `github`, `gitea`, `gitlab`, `gogs` and `gitbucket`, as the clone password for `git`. Leave unset for a public source. | |
| lfs_endpoint | No | Custom LFS endpoint, if the source doesn't serve LFS from the clone URL. | |
| auth_username | No | Username on the *source* instance, sent with the token as its password. Only for `git` (optional, defaults to `oauth2`), `onedev` and `codebase` (required); refused for the other services, which authenticate by token alone and ignore the token when given a username. Setting it turns on authentication. | |
| pull_requests | No | Also migrate pull requests. Requires a non-`git` `service`. Defaults to false. | |
| mirror_interval | No | Pull-mirror refresh interval in Forgejo duration form (e.g. `8h0m0s`). Only meaningful with `mirror = true`. |