執行 kf migrate plan 指令時,您應該會在指令視窗中看到輸出內容,如下列表單所示,列出指令執行的步驟,以及任何警告或遷移問題:
kf migrate plan > plan.yaml
Checking CF CLI is available
Checking CF CLI is authenticated
...
WARNING: plan has issues
Issues with domain "apps.internal" in space "kf-team-acceptance":
E04 - internal domains are not supported
Issues with application "spring-music" in space "kf-team-app":
E14 - app manifest must have a single process
Issues with service instance "logspinner-1" in space "kf-team-app":
E10 - syslog drain configuration is not supported
...
如何產生遷移計畫:
請確認您已使用 CF CLI 登入 CF Foundation。
根據所需的遷移範圍執行遷移作業,其中:
MY_ORG 會指定機構名稱。
MY_SPACE 會指定聊天室的名稱。
MY_APP 會指定應用程式名稱。
為整個 CF 基礎架構產生遷移計畫。
kf migrate plan > plan.yaml
產生機構的遷移計畫。
kf migrate plan --cf-org MY_ORG > plan.yaml
產生聊天室的遷移計畫
kf migrate plan --cf-org MY_ORG --cf-space MY_SPACE > plan.yaml
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Assessment and Migration\n\nThis document describes how to perform an assessment of your existing\nCloud Foundry (CF) Foundation, and how to migrate the CF Foundation,\nOrganization, Space, or App to Kf.\n\nMigration fit assessment\n------------------------\n\nUse the [`kf migrate scan-cf-cluster`](/migrate/kf/docs/2.5/cli/kf-migrate-scan-cf-cluster) command\nto generate a report containing an assessment of the migration readiness of a CF Foundation.\nYou can format the report as a spreadsheet (recommended) or text file.\n| **Note:** The report does not contain all the information retrieved from the CF API. Instead, it targets specific pieces of data that can be used to estimate portability to Kubernetes.\n\n### Prerequisites\n\n- The Kf CLI. See [Install Kf CLI](/migrate/kf/docs/2.5/install-cli) for the installation instructions.\n- The [`cf` CLI](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html) intalled as `cf`.\n- The `cf` CLI must be on your path.\n- The `cf` CLI must be authenticated with [admin read-only privileges](https://docs.cloudfoundry.org/uaa/uaa-user-management.html#admin-read-only) or higher on the CF Foundation.\n\n### Perform an assessment\n\n1. Validate the Foundation to be targeted.\n\n ```\n cf curl /v2/info\n ```\n2. Run the command to generate a spreadsheet containing the assessment report.\n\n **Note:** The assessment is run locally on your workstation using the Kf CLI, and no data is sent to Google. \n\n ```\n kf migrate scan-cf-cluster report.xlsx\n ```\n3. Review the assessment.\n\n If you plan to share the assessment, you can redact any\n information that you do not want to share.\n\nMigration\n---------\n\nPerform the following steps to migrate entities from CF:\n\n1. **Create migration plan** that describes the migration.\n\n2. **Edit the migration plan** to customize your migration.\n\n3. **Apply the migration plan** to perform the migration.\n\nThe following sections describe these steps in more detail.\n\n### Migration scopes\n\nYour first decision when performing a migration is to decide on the migration *scope*.\nThe scope determines the CF entity you want to migrate and the privileges you\nneed to perform the migration:\n\n- **Entire Foundation or Organization** : You must have [admin read-only privileges](https://docs.cloudfoundry.org/uaa/uaa-user-management.html#admin-read-only) or higher on the CF Foundation.\n\n- **Single Space or App** : You must have [Space Developer privileges](https://docs.cloudfoundry.org/concepts/roles.html#roles) or higher.\n\n | **Note:** If you have `scim.read` and `cloud_controller.admin_read_only` scopes, you can also query all Apps across all Spaces in an Organization.\n\n### Prerequisites\n\nTo perform a migration, you require:\n\n- **To create the migration plan** : The Kf CLI. See [Install Kf CLI](/migrate/kf/docs/2.5/install-cli) for the installation instructions.\n- **To apply the migration plan** : A GKE cluster running Kf. See [Install Kf](/migrate/kf/docs/2.5/install) for the installation instructions.\n- Access to a cluster with a Cloud Foundry installation.\n- CF CLI that has targeted the CF Foundation.\n- The privileges on the CF Foundation required by your desired migration scope, as shown above.\n\n### Create a migration plan\n\nUse the `kf migrate plan` command to create the migration plan.\n\nBy default, the command writes the migration plan to standard out. You typically redirect\nthe output to a yaml file so that you can customize the plan before applying it.\nFor example, the following command writes the output to standard out: \n\n```\nkf migrate plan\n```\n\nRedirect the output to a yaml file: \n\n```\nkf migrate plan \u003e plan.yaml\n```\n\nWhen you run the `kf migrate plan` command, you should see output in the command window\nin the form below listing the steps performed by the command and any warning or migration issues: \n\n```\nkf migrate plan \u003e plan.yaml\n\n Checking CF CLI is available\n Checking CF CLI is authenticated\n ...\n\n WARNING: plan has issues\n Issues with domain \"apps.internal\" in space \"kf-team-acceptance\":\n E04 - internal domains are not supported\n\n Issues with application \"spring-music\" in space \"kf-team-app\":\n E14 - app manifest must have a single process\n\n Issues with service instance \"logspinner-1\" in space \"kf-team-app\":\n E10 - syslog drain configuration is not supported\n ...\n```\n\n**To generate a migration plan:**\n\n1. Ensure that you have logged in to your CF Foundation by using the CF CLI.\n\n2. Perform the migration based on your desired migration scope, where:\n\n - \u003cvar translate=\"no\"\u003eMY_ORG\u003c/var\u003e specifies the name of the Organization.\n - \u003cvar translate=\"no\"\u003eMY_SPACE\u003c/var\u003e specifies the name of the Space.\n - \u003cvar translate=\"no\"\u003eMY_APP\u003c/var\u003e specifies the name of the App.\n\n 1. Generate a migration plan for an entire CF Foundation.\n\n ```\n kf migrate plan \u003e plan.yaml\n ```\n 2. Generate a migration plan for an Org.\n\n ```\n kf migrate plan --cf-org MY_ORG \u003e plan.yaml\n ```\n 3. Generate a migration plan for a Space\n\n ```\n kf migrate plan --cf-org MY_ORG --cf-space MY_SPACE \u003e plan.yaml\n ```\n 4. Generate a migration plan for an App.\n\n ```\n kf migrate plan --cf-org MY_ORG --cf-space MY_SPACE --cf-app MY_APP \u003e plan.yaml\n ```\n\nIf you see the following error after running any of these commands: \n\n You are not authorized to perform the requested action CF-NotAuthorized 10003\n\nYou do not have required privileges to read the necessary CAPI endpoints.\n\n### Edit the migration plan\n\nReview and optionally modify the generated migration plan to resolve any errors.\n\n### Apply the migration plan\n\nUse the `kf migrate apply` command to apply the migration plan and migrate the CF entity.\n\nTo apply a migration:\n\n1. Ensure that you have set `.kubeconfig` to target your Kf cluster.\n\n2. Ensure that you have access to a GKE cluster running a full\n Kf installation. That means you have run the following\n command to connect to the cluster:\n\n ```\n gcloud container clusters get-credentials CLUSTER_NAME \\\n --project=CLUSTER_PROJECT_ID \\\n --zone=CLUSTER_LOCATION\n ```\n3. Ensure that there are no existing Space names on your Kf cluster\n that will collide with a Space referenced in the migration plan.\n\n Space names are of the form \u003cvar translate=\"no\"\u003ecf-org\u003c/var\u003e-\u003cvar translate=\"no\"\u003ecf-space\u003c/var\u003e. For example,\n if the Org name is `myorg` and the Space name is `myspace`, then the\n Kf space will be `myorg-myspace`.\n4. Apply the migration plan.\n\n ```\n kf migrate apply -v --plan plan.yaml\n ```\n\n The verbose flag `-v` is recommended but not required. This flag causes the command\n to output the Kf commands used to perform the migration.\n | **Note:** You might see errors from the apply step. For example, `E04 - internal domains are not supported`. In some situations, you can ignore these errors by specifying the `--allow-issues` flag. Alternatively, you can edit the migration plan to address the error."]]