Skip to main content

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

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-name | Yes | N/A | 这必须设置为静态字符串: system-pat | | --target-visibility | 否 | internal | 目标存储库的可见性。 必须是 privateinternal。 不支持公共存储库。 | | --start | 否 | false | 创建迁移后,迁移会自动启动。 |

          `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-token | Yes | for personal access token (classic)GHE.com | | DEBUG_HTTP | --debug-http | 否 | 设置为 true 打印每个请求的 HTTP 方法、URL、标头和错误响应正文,以便进行调试 |