关于从 Bitbucket Server 迁移
可使用 GitHub Enterprise Importer 将存储库从 Bitbucket Server 迁移到 GitHub Enterprise Cloud(GitHub.com 或 GHE.com)。 仅 Bitbucket Server 或 Bitbucket 数据中心 5.14+ 或更高版本支持从 Bitbucket Server 进行迁移。
迁移的数据
目前仅支持将以下存储库数据从 Bitbucket Server 迁移到 GitHub Enterprise Cloud。
-
Git 源(包括提交历史记录)
-
拉取请求(包括注释、拉取请求审查、文件和行级别的拉取请求审查注释、所需的审阅者和附件)
注意
如果已合并拉取请求并且在迁移前在 Bitbucket 服务器上删除了头部分支,则用户在尝试查看拉取请求时可能会收到
500
错误。 Bitbucket 服务器删除对此类拉取请求对象的特定 Git 引用,因此无法迁移与拉取请求关联的那些 Git 对象。
不迁移的数据
目前,不会迁移以下数据。
- 用户拥有的个人存储库
- 分支权限
- 提交注释
- 存储库设置
- CI 管道
迁移数据的限制
GitHub Enterprise Importer 可以迁移的内容存在限制。 有些是由于 GitHub 的限制,而另一些是由于 GitHub Enterprise Importer 本身的限制。
GitHub
的限制
- 单个 Git 提交的大小限制为 2 GB:Git 存储库中的单个提交不能大于 2 GB。 如果有任何提交大于 2 GB,则需要将其拆分为较小的提交,使每个提交的大小不超过 2 GB。
- Git 引用的限制为 255 字节:单个 Git 引用(通常称为“ref”)的名称不能大于 255 字节。 通常,这意味着引用的长度不能超过 255 个字符,但任何非 ASCII 字符(如表情符号)都可能占用多个字节。 如果任何 Git 引用太长,将返回明确的错误消息。
- 100 MB 文件大小限制:完成迁移后,Git 仓库中的单个文件大小不能超过 100 MB。**** 在存储库迁移期间,此限制将增加到 400 MB。 请考虑使用 Git LFS 来存储大型文件。 有关详细信息,请参阅“管理大型文件”。
GitHub Enterprise Importer 的限制
- 仓库存档的 40 GB 大小限制 (公共预览版):Importer 无法迁移仓库存档中 git 数据和元数据合计超过 40 GB 的仓库。****
- 400 MB file size limit: When migrating a repository with GitHub Enterprise Importer, no single file in your Git repository can be larger than 400 MB. Consider using Git LFS for storing large files. For more information, see 管理大型文件.
- Git LFS objects not migrated: The Importer can migrate repositories that use Git LFS, but the LFS objects themselves will not be migrated. They can be pushed to your migration destination as a follow-up task after the migration is complete. For more information, see 复制仓库.
- Follow-up tasks required: When migrating between GitHub products, certain settings are not migrated and must be reconfigured in the new repository. For a list of follow-up tasks you'll need to complete after each migration, see 在 GitHub 产品之间迁移的概述.
- Delayed code search functionality: Re-indexing the search index can take a few hours after a repository is migrated, and code searches may return unexpected results until re-indexing is complete.
- Rulesets configured for your organization can cause migrations to fail: For example, if you configured a rule that requires email addresses for commit authors to end with
@monalisa.cat
, and the repository you're migrating contains commits that don't comply with this rule, your migration will fail. For more information about rulesets, see 关于规则集. - Mannequin content might not be searchable: Mannequins are placeholder users to which imported content (such as issues, pull requests, comments, etc.) is associated. When you search for content associated with a mannequin, such as assigned issues, the issues may not be found. Once a mannequin is reclaimed, the content should be found via the new owner. For more information, see 回收 GitHub Enterprise Importer 的模型.
入门
从 Bitbucket Server 迁移之前,应规划出如何开展迁移。 迁移数据之前,需要选择开展迁移的人。 必须向该人员授予迁移源和迁移目的地的所需访问权限。 我们还建议先开展测试迁移。
有关完整迁移过程的概述,请参阅“从 Bitbucket Server 迁移到 GitHub Enterprise Cloud 的概述”。