Skip to main content

Enterprise Server 3.21 目前作为发布候选版本提供。

企业实时迁移 命令行界面参考

CLI 工具的详细使用信息 ELM 。

注意

Enterprise Live Migrations 位于 公开预览,可能会有变动。

elm migration 命令

命令Description
elm migration create为单个源存储库创建新迁移
elm migration start --migration-id MIGRATION-ID开始迁移
elm migration status --migration-id MIGRATION-ID显示迁移的状态、进度、切换准备情况和时间安排
elm migration list列出所有迁移及其状态
elm migration cancel --migration-id MIGRATION-ID取消正在进行的迁移
elm migration cutover-to-destination --migration-id MIGRATION-ID启动最终切换,锁定源代码库并完成迁移

其中一些命令可以采用其他选项。 请参阅本文后面的部分。

elm migration create 选项

创建新的迁移以准备存储库导出和导入。

Flag必需DefaultDescription
--source-orgYesN/A源组织的 Slug GitHub Enterprise Server
--source-repoYesN/A源存储库的名称
--target-orgYesN/A目标组织在 GHE.com 的 Slug
--target-repoYesN/A目标存储库的名称
--target-apiYesN/A目标企业的 API URL(例如: https://api.octocorp.ghe.com) 。
不要在 URL 的末尾包含尾部斜杠。
--pat-nameYesN/A这必须设置为静态字符串: system-pat
--target-visibilityinternal目标存储库的可见性。 必须是 privateinternal。 不支持公共存储库。
--startfalse创建迁移后,迁移会自动启动。

elm migration list 选项

Flag必需DefaultDescription
--statusN/A按迁移状态筛选结果。 有效值:created、、queuedin_progress``pausedcompletedfailedterminated
--page-sizeN/A每页结果数
--afterN/A来自先前响应的分页游标

elm migration cutover-to-destination 选项

Flag必需DefaultDescription
--migration-idYesN/A已准备好进行最终切换的迁移的 ID。
--forcefalse默认情况下,该命令会检查迁移目标在继续之前是否报告就绪情况。 用于 --force 在确定迁移状态正确时绕过此检查。

全局标志和变量

可以将以下属性作为环境变量或任何命令上的标志提供,命令标志具有优先级。 应用__ 配置ghe-config,应设置这些值。

可变Flag必需Description
API_URL--api-urlYes必须设置为 http://localhost:1738
MIGRATION_MANAGER_HMAC_KEY--migration-manager-hmac-keyYes必须设置为 $(ghe-config secrets.elm-exporter.elm-exporter-hmac-keys)
MIGRATION_TARGET_URL--migration-target-urlYes目标企业的 API URL(例如: https://api.octocorp.ghe.com) 。
不要在 URL 的末尾包含尾部斜杠。
迁移目标标记 (MIGRATION_TARGET_TOKEN)--migration-target-tokenYesfor personal access token (classic)GHE.com
DEBUG_HTTP--debug-http设置为 true 打印每个请求的 HTTP 方法、URL、标头和错误响应正文,以便进行调试