code.gitea.io/gitea@v1.22.3/docs/content/development/migrations.en-us.md (about)

     1  ---
     2  date: "2019-04-15T17:29:00+08:00"
     3  title: "Migrations Interfaces"
     4  slug: "migrations-interfaces"
     5  sidebar_position: 55
     6  toc: false
     7  draft: false
     8  aliases:
     9    - /en-us/migrations-interfaces
    10  menu:
    11    sidebar:
    12      parent: "development"
    13      name: "Migrations Interfaces"
    14      sidebar_position: 55
    15      identifier: "migrations-interfaces"
    16  ---
    17  
    18  # Migration Features
    19  
    20  Complete migrations were introduced in Gitea 1.9.0. It defines two interfaces to support migrating
    21  repository data from other Git host platforms to Gitea or, in the future, migrating Gitea data to other Git host platforms.
    22  
    23  Currently, migrations from GitHub, GitLab, and other Gitea instances are implemented.
    24  
    25  First of all, Gitea defines some standard objects in packages [modules/migration](https://github.com/go-gitea/gitea/tree/main/modules/migration).
    26  They are `Repository`, `Milestone`, `Release`, `ReleaseAsset`, `Label`, `Issue`, `Comment`, `PullRequest`, `Reaction`, `Review`, `ReviewComment`.
    27  
    28  ## Downloader Interfaces
    29  
    30  To migrate from a new Git host platform, there are two steps to be updated.
    31  
    32  - You should implement a `Downloader` which will be used to get repository information.
    33  - You should implement a `DownloaderFactory` which will be used to detect if the URL matches and create the above `Downloader`.
    34    - You'll need to register the `DownloaderFactory` via `RegisterDownloaderFactory` on `init()`.
    35  
    36  You can find these interfaces in [downloader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/downloader.go).
    37  
    38  ## Uploader Interface
    39  
    40  Currently, only a `GiteaLocalUploader` is implemented, so we only save downloaded
    41  data via this `Uploader` to the local Gitea instance. Other uploaders are not supported at this time.
    42  
    43  You can find these interfaces in [uploader.go](https://github.com/go-gitea/gitea/blob/main/modules/migration/uploader.go).