To scale in disks for business changes or cost optimization, you can use Server Migration Center (SMC) to migrate an ECS instance to a custom image or a destination instance with smaller disks.
Migration limits
Currently, you cannot migrate ECS instances that are created from Alibaba Cloud Marketplace images. To use this feature, contact us to add your account to the whitelist.
Migration effects
Before you start the migration, note the following items. For more information, see the following table.
Affected items | Description |
Migrated data directories | During the migration, you can adjust the partition structure of the destination disk, including configurations such as partition size, position order, transfer method, and logical volume management (LVM). By default, all disks of the server are migrated:
|
Intermediate instance | Do not interfere with the intermediate instance. To prevent migration failure, do not stop, start, restart, or release the intermediate instance, or change its billing method during the migration. After the migration is complete, the intermediate instance is automatically released. Note
For more information, see Migration principles. |
IP address | The IP address changes after migration, which may cause service interruptions. We recommend that you perform the migration during off-peak hours. If your services involve IP address configurations, modify the domain name resolution and ICP filing information yourself after the migration.
|
Underlying hardware devices | The underlying hardware devices change after migration. This may invalidate some application licenses that are bound to hardware. Check your licenses. |
Performance impact | The migration process consumes server resources, including CPU, memory, disk I/O, and network bandwidth. |
Data consistency before and after migration | For information about data and system configuration changes that occur before and after migration, see Data consistency issues after migration. |
Preparations
You have completed the required preparations before migration.
You have read the migration guide to learn about the SMC client, migration principles, billing, migration process, and feedback channels.
To prevent data loss, we recommend that you back up important data to an image, a snapshot, or a storage device other than the instance before the migration.
When you migrate a server across international regions, the migration speed may be slow because of unstable public network environments. We recommend that you evaluate the migration time and test the transmission speed. We recommend that you use a VPN Gateway, Express Connect circuit, or Smart Access Gateway to connect the source server to an Alibaba Cloud VPC and migrate the server over a private network.
If you can directly access a VPC in a specific Alibaba Cloud region from your data center, virtual machine environment, or cloud host, we recommend that you use the private network migration solution of SMC. This method is faster and more stable than public network migration and improves migration efficiency.
If you want to migrate a source server to an existing ECS instance:
The operating system of the destination instance must match the operating system of the source server. For example, if the source server runs a Linux operating system, the destination instance must also run a Linux operating system.
The number of data disks attached to the destination instance must be greater than or equal to the number of data disks on the source server. If the destination instance has an insufficient number of data disks, you must attach a data disk.
The capacity of the system disk and data disks on the destination instance must be greater than or equal to the used capacity of the system disk and data disks on the source server. If the destination instance has insufficient disk capacity, you must resize a disk.
Migration procedure
If you want to migrate a Windows instance, you must compress the disk space before you import the migration source. Otherwise, you cannot reduce the disk capacity.
Step 1: Import the migration source
Use the console to automatically import the migration source (recommended)
The source server, which is the source ECS instance, must be able to access the Internet.
The source server must be in the Running state, and the Cloud Assistant Agent status must be Normal. For more information, see View the status of Cloud Assistant Agent and handle exceptions.
If you use a RAM user to import the migration source, you must grant the following permissions to the RAM user:
The AliyunECSReadOnlyAccess permission, which grants read-only access to ECS.
The AliyunECSAssistantFullAccess permission, which grants full management access to Cloud Assistant.
Go to the SMC console - Scale-in Migration.
On the Scale-in Migration page, click Import Migration Source.
Configure the parameters for the migration source and click Import.
The import process takes approximately 3 to 10 minutes. Please wait for the process to complete.
Parameter
Description
Migration Source Type
Alibaba Cloud ECS Instance.
Import Method
Select Console Import.
Authorize SMC to remotely connect to the source server from the console to automatically import the migration source. The Cloud Assistant feature is automatically called during the import process. Do not interrupt or exit the process.
Region
In the drop-down list, select the region where the server to be migrated resides.
Instance
You can search for and select the Alibaba Cloud ECS instances to be migrated in the specified region by instance ID/name or IP address. You can select multiple instances for batch import.
Tag (Optional)
Bind key-value pairs of tags to the migration task to facilitate querying and managing migration tasks. For more information, see Use tags to manage migration sources and migration tasks and Use tags for fine-grained permission management.
A maximum of 20 tags can be bound to a migration task.
Resource Group (Optional)
To group and manage migration resources by dimensions such as business department or project, you can create resource groups.
On the Scale-in Migration page of the SMC console, you can view the status of the migration source in the Real-time Migration Status column.
A status of Migration Source Online indicates a successful import.
If the status is not Migration Source Online, the import failed. Troubleshoot the issue using the following methods and then re-import the source.
You can troubleshoot the issue based on the error message in the console or by viewing the SMC client log file. The default installation directory of the SMC client is:
Windows server: C:\smc.
Linux server: /smc.
For common issues and solutions, see SMC FAQ and Troubleshoot errors.
Use a command to import the migration source
If the migration source is a physical machine, a virtual machine, or a server from another cloud platform, we recommend that you use the command line to import the migration source.
The source server must be able to access the Internet. If the source server has firewall restrictions, see What are the SMC service domain names? to obtain the SMC domain names and ports and add them to the firewall's whitelist.
If your source server cannot access the Internet or you want to use private network transmission to improve migration efficiency, see the private network migration solution.
Go to the SMC console - Scale-in Migration.
On the Scale-in Migration page, click Import Migration Source.
Configure the parameters and copy the activation code command as prompted on the page.
Parameter
Description
Migration Source Type
Alibaba Cloud ECS Instance
Import Method
Select Command-line Import.
Generate an activation code script command as needed and run it on the source server to import the migration source.
Migration Source Quota
The number of migration sources that can be activated by the activation code. The value ranges from 1 to 1,000. The default value is 200.
Validity Period
The validity period of the activation code. The value ranges from 1 to 90 days. The default value is 90 days.
Activation Code
The steps to generate an activation code are as follows:
Click Generate.
Based on the operating system of the source server, click the Linux Shell or Windows Powershell tab.
Click Copy to copy the activation code command.
Log on to the source server. Then, paste and run the copied command with administrator permissions to import the migration source.
Linux source server
Log on to the Linux server.
Paste and run the copied command with administrator permissions to import the migration source.

When the command is run, a message similar to
Import Source Server [s-bp18x8751kgz2oyh****] Successfully!is returned, which indicates that the migration source was successfully imported.
Windows source server
Log on to the Windows server.
Open Windows PowerShell as an administrator.
Paste and run the copied command to import the migration source.

When the command is run, a message similar to
Import Source Server [s-bp19rlidl3mwuptc****] Successfully!is returned, which indicates that the migration source was successfully imported.If the command fails to run, see What do I do if I fail to import a Windows migration source using the command line?.
On the Scale-in Migration page of the SMC console, you can view the status of the migration source in the Real-time Migration Status column.
A status of Migration Source Online indicates that the import was successful.
If the status is not Migration Source Online, the import failed. Troubleshoot the issue using the following methods and then re-import the source.
You can troubleshoot the issue based on the error message in the console or by viewing the SMC client log file. The default installation directory of the SMC client is:
Windows source server: C:\smc.
Linux source server: /smc.
For common issues and solutions, see SMC FAQ and Troubleshoot errors.
Import the migration source using the SMC client
You must run the client on the source server. By default, the public access mode is enabled. If the source server has firewall restrictions, see What are the SMC service domain names? to obtain the SMC domain names and ports and add them to the firewall's whitelist.
If your source server cannot access the Internet or you want to use private network transmission to improve migration efficiency, see the private network migration solution.
Go to the SMC console - Scale-in Migration.
On the Scale-in Migration page, click Import Migration Source.
On the Import Migration Source page, configure the following parameters.
Parameter
Description
Migration Source Type
Alibaba Cloud ECS Instance
Import Method
Select Client Import.
You must manually download and install the SMC client on the source server.
Import Instructions
In the Import Instructions section, download, install, and activate the appropriate SMC client based on the operating system (Linux or Windows) and architecture (32-bit or 64-bit) of the source server.
Click Generate Activation Code and copy the activation code information.
You need to enter the activation code when you install the client.
Import the migration source.
ImportantDo not close the SMC client during the migration. If you do, the migration source loses its connection with the SMC console and the migration fails.
Windows source server
Use a remote connection tool that supports file transfer, such as WinSCP, to upload the SMC client to the Windows source server.
On the Windows source server, use a decompression tool to decompress the SMC client package.
Run the SMC client from the folder that matches your source system version.
A prompt appears, requesting administrator permissions. Click OK.
GUI version: Double-click the go2aliyun_gui.exe application.
Command-line version: Double-click the go2aliyun_client.exe application.
Obtain an activation code or an AccessKey pair.
(Recommended) In the Import Instructions section of the SMC console, click Generate Activation Code and copy the activation code.
Obtain an AccessKey pair: The AccessKey pair of an Alibaba Cloud account consists of an AccessKey ID and an AccessKey secret. If you have not created an AccessKey pair, create one first.
Enter the activation code or AccessKey pair as prompted.
For the GUI version, in the Token Id/AK and Token Code/SK text boxes, enter the activation code or AccessKey pair, and then click Run. For more information, see the SMC client usage guide.
Command-line version: Enter the values for
access_access_token_idandaccess_token_code, and press theEnterkey.
When a message similar to
Import Source Server [s-bp18x8751kgz2oyh****] Successfully!is returned, the migration source has been successfully imported.
Linux source server
Use a remote connection tool that supports file transfer, such as WinSCP, to upload the SMC client to the Linux source server.
Remotely connect to the Linux source server and decompress the SMC client package.
This example uses the
Linux 64-bit General-purpose Edition. If you use another version of the SMC client, replace the package name in the command with the actual downloaded file name.tar -zxvf go2aliyun_client.tar.gzNoteThe Linux 64-bit ARM Edition supports the g6r general-purpose and c6r compute-optimized instance families. For more information about instance families, see Enterprise-level Arm-based compute instance families.
(Optional) You can filter and exclude files or directories that you do not want to migrate.
Obtain an activation code or an AccessKey pair.
(Recommended) Obtain an activation code: In the Import Instructions section of the SMC console, click Generate Activation Code and copy the activation code.
Obtain an AccessKey pair: The AccessKey pair of an Alibaba Cloud account consists of an AccessKey ID and an AccessKey secret. If you have not created an AccessKey pair, create one first.
In the SMC client folder, run the following commands to start the SMC client.
cd go2aliyun_client_linux_x86_64 sudo chmod +x go2aliyun_client sudo ./go2aliyun_clientEnter the activation code or AccessKey pair as prompted. This example uses an activation code:

After you enter the activation code or AccessKey pair, the following prompts may appear:
If no snapshot driver is installed on the source system, the SMC client displays the following prompt.
Because block replication needs to be disabled for Linux server scale-in migration, enter
no.ImportantIf the snapshot driver fails to install, do not enable block replication when you create a migration task. Otherwise, the migration fails.

Most mainstream source systems have rsync installed by default. If rsync is not installed, the SMC client prompts you to install it. Enter
yesto automatically install rsync.
If SELinux is enabled on the source system, the SMC client prompts you to disable it. Enter
yesto automatically disable SELinux.
When a message similar to
Import Source Server [s-bp11npxndknsycqj****] Successfully!is returned, the migration source is successfully imported.NoteIf the migration source fails to import, you can troubleshoot the issue based on the returned message. Then, run the following commands in sequence to exit the background program and re-import the migration source. For more information about common issues and solutions, see SMC FAQ and Troubleshoot errors.
sudo ./go2aliyun_client --abort sudo ./go2aliyun_client
On the Scale-in Migration page of the SMC console, you can view the status of the migration source in the Real-time Migration Status column.
The import is successful if the status is Migration Source Online.
If the status is not Migration Source Online, the import failed. Troubleshoot the issue using the following methods and then re-import the source.
You can troubleshoot the issue based on the error message in the console or by viewing the SMC client log file. The default installation directory of the SMC client is:
Windows source server: C:\smc.
Linux source server: /smc.
For common issues and solutions, see SMC FAQ and Troubleshoot errors.
Step 2: Configure the migration
In the Actions column of the target migration source, click Start Migration.
Configure the required parameters and click Start Migration. In the pop-up window, read the notes on scale-in migration and select I Have Read And Understood The Notes to create the migration task.
Configure basic parameters.
Parameter
Description
Destination Type (Required)
You can select a target type based on your migration scenario:
ECS Image
Convert the existing source server into a custom ECS image, and then use the custom image to create a new ECS instance to complete the migration.
The following table describes the configuration items.
Destination Region: The Alibaba Cloud region to which you want to migrate the source server. This parameter is required. For more information about regions, see Regions and zones.
Image Name Prefix: The custom name of the image after migration.
ECS Instance
Directly migrate the source server to a purchased ECS instance. The storage, operating system, and other configurations of the source server and the purchased ECS instance must be compatible.
ImportantWhen you migrate to a destination instance, the operating system of the destination instance is replaced first. The automatic snapshots of the system disk are cleared and cannot be recovered. To retain automatic snapshots for future use or data security, you can disable automatic snapshot release with disk before the migration.
The following table describes the configuration items.
Destination Region: The destination region is the Alibaba Cloud region to which you want to migrate your source server. This parameter is required. For more information about regions, see Regions and zones.
Destination Instance: Select an ECS instance as the destination instance.
Automatic Incremental Synchronization
Specifies whether to automatically synchronize incremental data from the source server to Alibaba Cloud for the migration task. By default, automatic incremental synchronization is disabled.
If you enable this switch, you must set the following configuration items:
Synchronization Repetition Frequency: The interval at which the incremental migration task is periodically and automatically executed.
Maximum Image Retention Count: The maximum number of images that are retained by default for the incremental migration task.
The migration task is automatically executed periodically, and incremental data is synchronized to Alibaba Cloud. For more information about the best practices for incremental migration, see Incremental server migration.
If you disable this switch, the migration task is executed only once.
Enable Migration Template
This parameter is available only when Target Type is set to ECS Image.
A migration template is used to preset the parameters of a migration task. When you start the migration, the template parameters are automatically filled. For more information about how to set a migration template, see Set a migration template.
Network Mode
Select the network used to transfer migration data to the intermediate instance. By default, the Internet is used for transmission. The intermediate instance is created in the selected VPC and vSwitch, and a public IP address is automatically assigned.
Public Network Transmission (Default)
Migration data is transmitted to the intermediate instance over the Internet. If you use this mode, the source server must be able to access the Internet. Specify a VPC and a vSwitch as needed.
Specify a VPC and a vSwitch: The migration task creates an intermediate instance in the VPC and vSwitch that you specify.
Do not specify a VPC and a vSwitch: The migration task creates an intermediate instance in a new VPC and vSwitch that are automatically created by the system.
Private Network Transmission
Migration data is transmitted to the intermediate instance over the VPC internal network. If you use this mode, you must connect the source server to an Alibaba Cloud VPC and specify a VPC and a vSwitch.
NoteIf you can directly access a VPC in a specific Alibaba Cloud region from a data center, a virtual machine environment, or a cloud host, we recommend that you use this method for migration. Using internal network transmission provides faster and more stable data transmission than using the public network, which improves migration efficiency. You can use a VPN Gateway, an Express Connect circuit, a physical Express Connect circuit, or a Smart Access Gateway to connect the source server to a cloud VPC. For more information, see Connect a VPC to a data center, an office terminal, or another cloud.
Destination Instance IPv4 Private Address
This parameter is available only when Target Type is set to ECS Instance.
Keep Unchanged: By default, the migration IP address of the destination instance is used and does not change.
Manually Specify: Allows you to enter an address within the available IP address range of the vSwitch where the destination instance is located. When the IP address of the migration source is in the CIDR block of the vSwitch, you can change the IP address of the destination instance to the IP address of the migration source.
When the CIDR block of the destination instance is the same as that of the migration source: Directly enter the private IP address of the migration source.
When the CIDR block of the destination instance is different from that of the migration source: You need to first change the VPC of the destination instance to make the CIDR block of the destination instance the same as that of the migration source, and then enter the private IP address of the migration source.
Adjust the disk partition structure as required.
Parameter
Description
Adjust Disk Partition Structure
Adjust Disk Partition Structure is enabled by default. This feature is supported only by SMC client V2.8.0 and later. For more information about the SMC client, see SMC client usage guide.
Linux system

Block replication is disabled by default. You can modify the disk size and partition size to configure scale-in migration.
The disk size must be greater than the actual used capacity of the source disk.
For example, if the source disk size is 60 GiB and the actual used space is 30 GiB, the disk size must be greater than 30 GiB.
The disk size must be greater than the sum of the partition sizes.
For example, if the disk size is 40 GiB, the sum of the partition sizes must be less than 40 GiB.
For more information about other parameters, see Description of disk partition structure parameters.
Windows system
Block replication is enabled by default and cannot be modified. The custom disk size must be greater than the sum of the partition sizes.
ImportantMake sure that you have compressed the disk space for this migration source before importing it. Otherwise, you cannot reduce the capacity.

For more information about other parameters, see Description of disk partition structure parameters.
On the Server Migration page, you can view the real-time migration status.
If you enabled migration drill, SMC first performs the migration drill. The transmission time is affected by factors such as data volume and network bandwidth. Wait for the migration task to complete.
NoteSpeed: The amount of uncompressed migration data transmitted per second. If the Compression Ratio is set to a value greater than 0 when creating the migration task, the displayed speed will be higher than the actual network transmission speed of the compressed data.
Remaining Synchronization Time: The estimated time until the synchronization is complete, calculated as (Total data volume - Transmitted data volume) / Synchronization speed.
If the transmission speed is too low for your plan, you can temporarily increase the fixed bandwidth of the source and destination servers. For more information, see Evaluate the migration time and test the transmission speed.
(Optional) View migration details.
In the Migration Source ID/Name column, click the ID of the target migration source to view its details.
Verify the migration result
A Real-time Migration Status of Completed indicates a successful migration.
If the Target Type for the migration is ECS Image:
After a successful migration, an Alibaba Cloud custom image is generated. Scroll to the right to find the Migration Deliverable column and click View Report to view the image detection results.
Manually verify the migration result (recommended)
In the Actions column, click Create Instance. You are redirected to the ECS console to create an ECS instance. The custom image is selected by default. For more information, see Create an instance from a custom image. The default system disk type and capacity may differ from those of the source disk. You can adjust these settings as needed.

Automatically verify the migration result
NoteTo use this feature, you must install the Cloud Assistant plugin on the instance. The instance must run a supported operating system version. For more information, see Install Cloud Assistant Agent.
This feature uses the
ACS-SMC-CreateAndVerifyInstanceOOS template provided by Alibaba Cloud to automatically verify that an ECS instance can be created from the generated image and start normally.In the Actions column, click Verify Migration Result.

In the pop-up dialog box, review the verification process and click Verify Now.
You can also click Customize Verification Script Parameters to manually configure verification parameters.
You can view the verification result in the Verify Migration Result column.
Verification Passed: The migration was successful. Click Details for more information.
Verification Not Completed: This status indicates that the migration is abnormal. Click View Reason to determine the cause of the error and troubleshoot the issue.
You can also click
in the Actions column and select Go To OOS To View Historical Verifications to view the execution history of the OOS template.
If the Target Type for the migration is ECS Instance, you can click View Destination Instance in the Actions column to view the destination ECS instance.
If the migration drill status is
, the migration drill failed.Review the drill report, resolve all Critical drill items, and then retry the migration drill. For more information, see Configure a migration drill.
The migration task failed if the Real-time Migration Status is Error.
In this case, you must troubleshoot the problem and retry the migration:
In the Actions column, click Troubleshoot Error and resolve the issue based on the error code and error message. For more information, see SMC FAQ and Troubleshoot errors.
After fixing the problem, click Retry Migration in the Actions column to resume the migration from where it left off.
ImportantIf the intermediate instance was released, you must start the migration again. For more information, see What do I do if I accidentally release an intermediate instance?.
What to do next
After a successful migration, perform the following operations to ensure that your business runs as expected:
Perform data verification and validation to ensure data integrity. For more information, see How do I check the system after migrating a Linux server? or How do I check the system after migrating a Windows server?.
If the applications and services on the source server are not configured to start automatically, you must manually start them after the migration.
The IP address changes after migration. If your business uses a specific IP address configuration, you must modify settings such as domain name resolution and ICP filing after the migration.
If a domain name is bound to the source server, resolve the domain name to the new public IP address of the server. For more information, see Add a website for DNS resolution.
If you want to keep the private IP address, you can modify it after the migration is complete.
Migrate using an ECS Image: Specify a primary private IPv4 address when you create an ECS instance.
Migrate to a Destination Instance: If you did not modify the private IPv4 address in the advanced configuration of the migration settings step, you can still modify the primary private IPv4 address for the ECS instance after the migration.
Clean up resources
Migrate to an ECS image
During the migration, SMC creates a temporary pay-as-you-go intermediate instance named No_Delete_SMC_Transition_Instance in your destination Alibaba Cloud account. This instance assists with the migration. You must decide whether to manually clean it up based on the migration outcome:
Successful migration: The intermediate instance is automatically released. You do not need to manually clean it up.
Migration error: The intermediate instance continues to exist with the migration task and incurs fees. You can release it in one of the following ways to avoid unnecessary charges:
If you no longer need the migration task, click the migration source ID, and in the Actions column for the task, click Cancel Migration Job to delete the migration task and clean up the intermediate instance.
Manually release the intermediate instance.
Migrate to an ECS instance
During the migration, SMC creates a temporary pay-as-you-go intermediate disk named SMC_Temp_Disk for the destination instance. This disk assists with the migration. You must decide whether to manually clean up the intermediate disk based on the migration outcome:
Successful migration: The intermediate disk is automatically released. You do not need to manually clean it up.
Migration error: The intermediate disk continues to exist with the migration task and incurs fees. You can release it in one of the following ways to avoid unnecessary charges:
To delete a migration task and automatically clean up its intermediate disk, click the migration source ID, and then in the Actions column for the task, click Cancel Migration Job.
Manually release the intermediate disk.
References
To migrate incremental data multiple times, you can perform multiple incremental migrations at custom intervals after the initial full migration is complete. This process synchronizes the incremental data from the source server to Alibaba Cloud, which reduces business downtime and the final cutover time. For more information, see Incremental server migration.
For common issues and solutions, see FAQ and Troubleshooting.
icon in front of the mount target.
icon, and then click Disk Management.

