注意
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 | 必需 | Default | Description |
|---|---|---|---|
--source-org | Yes | N/A | 源组织的 Slug GitHub Enterprise Server |
--source-repo | Yes | N/A | 源存储库的名称 |
--target-org | Yes | N/A | 目标组织在 GHE.com 的 Slug |
--target-repo | Yes | N/A | 目标存储库的名称 |
--target-api | Yes | N/A | 目标企业的 API URL(例如: https://api.octocorp.ghe.com) 。 |
**不要**在 URL 的末尾包含尾部斜杠。 |
| --pat-name | Yes | N/A | 这必须设置为静态字符串: system-pat |
| --target-visibility | 否 | internal | 目标存储库的可见性。 必须是 private 或 internal。 不支持公共存储库。 |
| --start | 否 | false | 创建迁移后,迁移会自动启动。 |
`elm migration list` 选项
| Flag | 必需 | Default | Description |
|---|---|---|---|
--status | 否 | N/A | 按迁移状态筛选结果。 有效值:created、、queued、in_progress``paused、completed、failed。 terminated |
--page-size | 否 | N/A | 每页结果数 |
--after | 否 | N/A | 来自先前响应的分页游标 |
`elm migration cutover-to-destination` 选项
| Flag | 必需 | Default | Description |
|---|---|---|---|
--migration-id | Yes | N/A | 已准备好进行最终切换的迁移的 ID。 |
--force | 否 | false | 默认情况下,该命令会检查迁移目标在继续之前是否报告就绪情况。 用于 --force 在确定迁移状态正确时绕过此检查。 |
全局标志和变量
可以将以下属性作为环境变量或任何命令上的标志提供,命令标志具有优先级。 应用ghe-config配置_后_,应设置这些值。
| 可变 | Flag | 必需 | Description |
|---|---|---|---|
| API_URL | --api-url | Yes | 必须设置为 http://localhost:1738。 |
| MIGRATION_MANAGER_HMAC_KEY | --migration-manager-hmac-key | Yes | 必须设置为 $(ghe-config secrets.elm-exporter.elm-exporter-hmac-keys)。 |
| MIGRATION_TARGET_URL | --migration-target-url | Yes | 目标企业的 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、标头和错误响应正文,以便进行调试 |