Move a Tair (Redis OSS-compatible) instance to a different virtual private cloud (VPC) or vSwitch without rebuilding the instance. Use this when your application and your Tair instance are in different VPCs and need to communicate over an internal network, or when you want to consolidate database resources under a shared CIDR block.
The instance endpoint (for example, r-hp3bpn39cs1vu****.redis.hangzhou.rds.aliyuncs.com) does not change after the operation. Connect your applications to the instance using the endpoint rather than the virtual IP address (VIP).
Before you begin
Check whether your instance type is eligible. Not all instance types support this operation:
| Instance type | Supported operation |
|---|---|
| Standard instance | Change VPC or vSwitch |
| Classic cluster instance (no private endpoint) | Change VPC or vSwitch |
| Classic cluster instance (with private endpoint) | Release the private endpoint first, change the VPC, then re-enable the private endpoint. See Enable the direct connection mode. |
| Cloud-native cluster instance (direct connection mode) | Cannot change VPC |
Also confirm the following:
Password-free access is disabled. If it is enabled, disable it before proceeding. See Enable password-free access.
No active Data Transmission Service (DTS) tasks. If a data migration or synchronization task involving this instance is running, the operation returns an error. See What is DTS?
Impacts
The following changes occur during and after the operation:
| Impact | Details |
|---|---|
| Connection interruption | Approximately 30 seconds. Perform the change during off-peak hours and make sure your application can automatically reconnect. |
| VIP change | The VIP changes. Applications connected via VIP lose their connections when the VIP changes. |
| DMS interruption | Data Management (DMS) connections drop briefly, then resume automatically. |
Use cases
| Operation | When to use |
|---|---|
| Change the VPC | A client cannot reach the instance because they are in different VPCs. For example, your ECS instance is in VPC A but your Tair instance is in VPC B. Move the Tair instance to VPC A to enable internal network communication. |
| Change the vSwitch | Group database-related resources (ECS instances and Tair instances) under the same vSwitch so they share a CIDR block and are easier to manage centrally. |
Change the VPC or vSwitch
Log on to the console and go to the Instances page. In the top navigation bar, select the region where your instance resides. Find the instance and click its ID.
In the Basic Information section, click Modify next to the VPC ID.
To change only the vSwitch, click Modify next to the vSwitch ID instead.
In the panel that appears, select the VPC and vSwitch.
If no VPC or vSwitch is available in the drop-down list, create them first. See Create and manage a VPC and Create and manage a vSwitch.
Click OK.
WarningThe change causes a connection interruption of approximately 30 seconds. Perform this step during off-peak hours and confirm your application has automatic reconnect enabled.
Read the confirmation message and click OK.
After the change completes, clear the cache on your clients. Otherwise, clients may be unable to write data to the instance and can only read data from the instance.
API reference
| API | Description |
|---|---|
| SwitchNetwork | Changes the VPC or vSwitch of an instance. |