summaryrefslogtreecommitdiffstats
path: root/docs/content/doc/developers/migrations.en-us.md
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2020-10-23 10:59:45 -0500
committerGitHub <noreply@github.com>2020-10-23 11:59:45 -0400
commit1d6b565de452d24e1db0ca21ba69289809fdc32a (patch)
tree90baf36836e97916c0469da6ecd5605c81e80b00 /docs/content/doc/developers/migrations.en-us.md
parentbfc553164aafaacf5a82427b85145aa2ef34aaa3 (diff)
downloadgitea-1d6b565de452d24e1db0ca21ba69289809fdc32a.tar.gz
gitea-1d6b565de452d24e1db0ca21ba69289809fdc32a.zip
Refactor docs (#13275)
* First pass Signed-off-by: jolheiser <john.olheiser@gmail.com> * More changes Signed-off-by: jolheiser <john.olheiser@gmail.com> * Redirects Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'docs/content/doc/developers/migrations.en-us.md')
-rw-r--r--docs/content/doc/developers/migrations.en-us.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/docs/content/doc/developers/migrations.en-us.md b/docs/content/doc/developers/migrations.en-us.md
new file mode 100644
index 0000000000..7af0138960
--- /dev/null
+++ b/docs/content/doc/developers/migrations.en-us.md
@@ -0,0 +1,41 @@
+---
+date: "2019-04-15T17:29:00+08:00"
+title: "Migrations Interfaces"
+slug: "migrations-interfaces"
+weight: 30
+toc: true
+draft: false
+menu:
+ sidebar:
+ parent: "developers"
+ name: "Migrations Interfaces"
+ weight: 55
+ identifier: "migrations-interfaces"
+---
+
+# Migration Features
+
+Complete migrations were introduced in Gitea 1.9.0. It defines two interfaces to support migrating
+repository data from other git host platforms to Gitea or, in the future, migrating Gitea data to other
+git host platforms.
+Currently, migrations from Github, Gitlab, and other Gitea instances are implemented.
+
+First of all, Gitea defines some standard objects in packages [modules/migrations/base](https://github.com/go-gitea/gitea/tree/master/modules/migrations/base).
+They are `Repository`, `Milestone`, `Release`, `ReleaseAsset`, `Label`, `Issue`, `Comment`, `PullRequest`, `Reaction`, `Review`, `ReviewComment`.
+
+## Downloader Interfaces
+
+To migrate from a new git host platform, there are two steps to be updated.
+
+- You should implement a `Downloader` which will be used to get repository information.
+- You should implement a `DownloaderFactory` which will be used to detect if the URL matches and create the above `Downloader`.
+ - You'll need to register the `DownloaderFactory` via `RegisterDownloaderFactory` on `init()`.
+
+You can find these interfaces in [downloader.go](https://github.com/go-gitea/gitea/blob/master/modules/migrations/base/downloader.go).
+
+## Uploader Interface
+
+Currently, only a `GiteaLocalUploader` is implemented, so we only save downloaded
+data via this `Uploader` to the local Gitea instance. Other uploaders are not supported at this time.
+
+You can find these interfaces in [uploader.go](https://github.com/go-gitea/gitea/blob/master/modules/migrations/base/uploader.go).