Help Center/ Migration Center/ User Guide/ New Edition/ Application Migration Projects/ Migration Workflows/ Adding a Pre-/Post-Migration Stage and Step (Checkpoints and Scripts)
Updated on 2026-01-09 GMT+08:00

Adding a Pre-/Post-Migration Stage and Step (Checkpoints and Scripts)

Adding checkpoints to migration workflows helps you monitor, intervene, or verify the migration process. Adding execution scripts helps you clean and reset environments after the migration.

Precautions

  • This function is applicable to stages and steps in the Waiting or Paused status, not those in the Running or Complete status.
  • If the previous stage or step is in the Running, Paused, or Complete state, you can only add post-migration stages or steps.

Adding a Pre-/Post-Migration Stage

  1. In the Workflow Progress area, move the cursor to the number next to Stage progress of the Migrate stage.
  2. In the displayed window, click Add Stage Before or Add Stage After. The Adding a Stage dialog box is displayed on the right.

  3. Enter a stage name and description, click Add Step, enter a step name and description, and click Confirm. Multiple steps can be added.
  4. After all steps are added, click Confirm.

    Manually added stages can be modified or deleted, but pre-defined stages cannot.

Adding a Pre-/Post-Migration Step

  1. In the Workflow Progress area, move the cursor to the number next to Stage progress of the Migrate stage.
  2. In the displayed Stage Details dialog box, click Add Step Before or Add Step After for a step. The Adding a Step dialog box is displayed on the right.

  3. Enter a step name and description and click Confirm. You need to manually confirm this step, so that the workflow can continue.
  4. Go back to the migration stage and check the added step.

    Manually added steps can be modified or deleted, but pre-defined steps cannot.

Adding a Post-Migration Stage and an Execution Script

To improve migration efficiency and accuracy, MgC can run execution scripts you configured when setting a migration workflow. MgC pulls script details from the COC, detects high-risk commands, and checks whether necessary components have been installed on the executor. You can also add post-migration stages to all workflow resources, execute custom scripts, and check the execution details.

  • Server migration: Add a post-migration stage and scripts before the workflow starts or when the workflow enters the Complete cutover stage. Storage migration: Add a post-migration stage and scripts before starting the workflow.
  • A maximum of 10 steps can be added to a post-migration stage, including checkpoints and scripts.

The following uses a batch server migration workflow as an example.

  1. In the Workflow Progress area, move the cursor to the number next to Stage progress of the Complete cutover stage.
  2. In the displayed window, click Add Stage After. The Adding a Stage dialog box is displayed on the right.

  3. Set the Name and Description as required or keep the default ones. Click Add Step and set script parameters according to Table 1.

    Table 1 Script parameters

    Parameter

    Description

    Type

    Select Script in this example.

    Name

    Customizable.

    Description (Optional)

    Source

    • Public: The system pulls the public script list from COC.
    • Custom: The system pulls the custom script list from COC.

  4. Click Select Script. The script list is displayed on the right.
  5. Select a script and click OK. The script information is displayed.
  6. Set the following parameters as required.

    • Input Parameters: Set it as required or keep the default value.
    • Executed By: The user who executes the script on a target instance node. Set it as required or keep the default value (root).
    • Timeout Interval: How many seconds before the script times out on a single target instance. Set it as required or keep the default value (300).

  7. Select an executor ECS from the Execution Servers drop-down list.
  8. Click Confirm. You can add multiple steps.
  9. After all steps are added, click Confirm. The post-migration stage and scripts are added.
  10. In the Workflow Progress area, check the added post-migration stage and scripts.

    • Do not modify script parameters during script execution, including but not limited to adding new input parameters. If the COC service ticket cannot be created due to such modifications, roll back the script to the previous version and try again.
    • If the script fails to be executed, click View Details to check the failure cause on the COC console. After the error is fixed, retry your operation on the MgC console. Alternatively, skip the abnormal script.