If a subscription ApsaraDB RDS for MySQL instance is automatically released due to expiration, or if a pay-as-you-go or serverless RDS instance is manually released or automatically released due to overdue payments, the RDS instance is moved to the recycle bin. You can unlock, rebuild, or destroy the RDS instance in the recycle bin.
The system backs up an RDS instance when the RDS instance is being deleted. If the RDS instance is being backed up and the deletion process is not complete, the recycle bin feature is unavailable for the RDS instance. If the deletion process is not complete, the RDS instance is in the Deleting state. The period of time that is required to delete an RDS instance varies based on the data volume and configuration of the RDS instance. Wait until the status of the RDS instance changes to Deleted.
Sample scenarios
Your subscription RDS instance is locked due to expiration and moved to the recycle bin. To unlock the RDS instance, you can renew the RDS instance within seven days. If you do not renew the RDS instance within seven days, you can only rebuild the RDS instance from the recycle bin and restore the data of the RDS instance to a new RDS instance. For more information, see Rebuild an RDS instance.
Feature description
|
Recycle bin feature category |
Specific scenarios |
|
Scenarios in which instances are moved to the recycle bin |
|
|
Scenarios in which instances are not moved to the recycle bin |
|
-
If the RDS instance uses a phased-out instance type and is moved to the recycle bin, you can rebuild the RDS instance from the recycle bin to an RDS instance that uses an available instance type. You can also retain the last backup file of your RDS instance before you release the RDS instance. Then, you can use the backup file to rebuild the RDS instance from the recycle bin to an RDS instance that uses an available instance type.
-
After an RDS instance is released, the backup files of the RDS instance are retained in the following scenarios:
-
Cross-region backups for RDS MySQL, cross-region backups for RDS SQL Server, and cross-region backups for RDS PostgreSQL (within the retention period).
-
If an RDS instance for which a backup retention policy after release is configured is released or unsubscribed, the data backup files of the RDS instance are not deleted along with the RDS instance and can be downloaded to an on-premises device.
-
Instance statuses and operation permissions within different time ranges
Subscription RDS instances

For example, your subscription RDS instance expired at 00:00:00 on January 4, 2024, and the RDS instance was released at 00:00:26 on January 11, 2024. In this case, you can renew and unlock the RDS instance within the time range from 00:00:00 on January 4, 2024 to 00:00:26 on January 11, 2024, and rebuild and restore the RDS instance within the time range from 00:00:26 on January 11, 2024 to 00:00:00 on January 19, 2024. After 00:00:00 on January 19, 2024, the RDS instance was destroyed.
Pay-as-you-go RDS instances and serverless RDS instances
-
Manual release

For example, you manually released your pay-as-you-go RDS instance at 21:38:33 on January 12, 2024. You can restore the pay-as-you-go RDS instance within the time range from 21:38:33 on January 12, 2024 to 00:00:00 on January 20, 2024. After 00:00:00 on January 20, 2024, the pay-as-you-go RDS instance was destroyed.
-
Locked due to overdue payments

For example, a pay-as-you-go RDS instance was suspended at 21:25:13 on January 5, 2024 due to overdue payments, and was released at 21:38:33 on January 12, 2024. In this case, you can settle the overdue payments and unlock the RDS instance within the time range from 21:25:13 on January 5, 2024 to 21:38:33 on January 12, 2024, and rebuild and restore the RDS instance within the time range from 21:38:33 on January 12, 2024 to 00:00:00 on January 20, 2024. After 00:00:00 on January 20, 2024, the RDS instance was destroyed.
-
To export data of an RDS instance in the recycle bin, you must unlock the RDS instance or rebuild the RDS instance, export data of the RDS instance, and then release the RDS instance. For more information, see Unlock an RDS instance, Rebuild an RDS instance, and Release or unsubscribe from an instance. For more information about data export, see Database export.
-
Some locked RDS instances are read-only. You can execute statements to query data on the RDS instances but cannot export data of the RDS instances. For more information, see What do I do if my ApsaraDB RDS instance is in the Locking state?
Unlock an RDS instance
Unlock a pay-as-you-go RDS instance whose payment is overdue
If your pay-as-you-go RDS instance is locked due to overdue payments, check the payment method of your Alibaba Cloud account.
Renew and unlock a subscription RDS instance
If your subscription RDS instance is locked due to expiration, you can renew the RDS instance in the recycle bin within seven days. If you do not renew the RDS instance within seven days, the RDS instance is released.
-
Go to the Instances page.
-
In the left-side navigation pane, click Recycle Bin. Then, select the region where the required RDS instance resides.
-
Find the locked RDS instance and click Unlock to renew the RDS instance.
After the RDS instance is renewed, the RDS instance is immediately restored to normal.
Rebuild an RDS instance
Prerequisites
If the RDS instance uses cloud disks, the network type of the RDS instance must be VPC.
Usage notes
-
If the Transparent Data Encryption (TDE) feature is enabled for an RDS instance, the backup files of the RDS instance cannot be used to rebuild the RDS instance. For more information, see Configure transparent data encryption (TDE).
-
By default, the rebuilt RDS instance uses the same instance type as the original RDS instance and resides in the same zone as the original RDS instance. However, if the instance type of the original RDS instance is no longer available for purchase, you must select an available instance type when you restore the original RDS instance to a new RDS instance. For more information about the historical and available instance types, see Standard primary instance types for ApsaraDB RDS for MySQL (x86).
-
After an RDS instance is rebuilt, the data of the original RDS instance is restored to a new RDS instance. However, the new RDS instance does not inherit the ID or endpoint of the original RDS instance. You can change the endpoint of the new RDS instance to the endpoint of the original RDS instance. This way, your applications can connect to the new RDS instance by using the original endpoint. For more information, see Manage instance endpoints and ports.
NoteYou can reuse the original endpoint only if the endpoint is not occupied by another instance. If the prefix of the desired endpoint is already occupied by another instance, an error message indicating that the endpoint prefix already exists is displayed when you change the endpoint, the error code
OtherEndpoint.Existis returned, and the change fails. In this case, you must use a different endpoint prefix or release the instance that occupies the endpoint prefix. -
When an RDS instance is moved to the recycle bin, the IP address whitelists of the RDS instance become invalid. After the RDS instance is rebuilt and the data of the RDS instance is restored to a new RDS instance, you must create IP address whitelists for the new RDS instance.
-
The classic network has been fully retired. When you rebuild an instance that was connected to the classic network from the recycle bin, you must select a virtual private cloud (VPC). After the instance is rebuilt, the endpoint of the instance changes, and you must update the database connection configurations on the application side accordingly.
Procedure
-
Go to the Instances page and select the region where the required RDS instance resides.
-
Click Recycle Bin.
-
Find the locked RDS instance and click Rebuild.
The recycle bin list displays only basic information such as the instance ID, name, database type, and zone, and does not display detailed specifications such as CPU, memory, storage type, and storage capacity. To view the complete specifications of a released instance, view the source instance section in the rebuild process.
-
The top of the rebuild page displays the complete configurations of the original RDS instance, such as CPU, memory, storage type, storage capacity, and database version. By default, the specifications are the same as those of the original RDS instance. Adjust the specifications as needed and click Confirm Order.
-
Click Subscribe. This step is required only for subscription RDS instances.
FAQ
Destroy an RDS instance
After you destroy an RDS instance, only the cross-region backup files of the RDS instance are retained. All regular data backup files, archived backup files, and log backup files of the RDS instance are destroyed. Proceed with caution when you destroy an RDS instance. For more information about cross-region backup files, see Cross-region backup.
If an RDS instance is locked due to overdue payments or expiration, you can destroy the RDS instance in the recycle bin.
RDS instances that are newly moved to the recycle bin cannot be immediately destroyed due to cache synchronization delays. In most cases, you can destroy the RDS instances approximately 10 minutes after the RDS instances are moved to the recycle bin. If an RDS instance is moved to the recycle bin, the billing of the RDS instance immediately stops.
-
Go to the Instances page.
-
In the left-side navigation pane, click Recycle Bin. Then, select the region where the required RDS instance resides.
-
Find the required RDS instance and click Destroy. In the message that appears, click OK.