All Products
Search
Document Center

ApsaraDB RDS:Restore the data of an ApsaraDB RDS for SQL Server instance

Last Updated:Jan 24, 2024

If a backup file is created for an ApsaraDB RDS for SQL Server instance, you can restore the backup data to an existing RDS instance or a new RDS instance. This is suitable for the analysis of historical data and the restoration of the data on which unintended operations are performed.

Feature description

You can use one of the following methods to restore the data of your RDS instance:

Note

If you want to restore all data of an RDS instance to another RDS instance in the same region, you can refer to this topic. If you want to restore data across regions or restore the backup files of an RDS instance to a self-managed database, you can refer to Methods to restore an ApsaraDB RDS for SQL Server instance.

Restore the data to an existing RDS instance

You can restore the data of your RDS instance to an existing RDS instance, including the original RDS instance, from a data backup file or to a specific point in time. During this process, you can restore some or all of the databases that are created on your RDS instance.

Restoration rules

Item

Description

Database engine version

The database engine version of the existing RDS instance must be later than or equal to the database engine version of the original RDS instance.

RDS edition

The RDS edition of the existing RDS instance must be higher than or equal to the RDS edition of the original RDS instance. The following RDS editions are listed in descending order: RDS Cluster Edition, RDS High-availability Edition, and RDS Basic Edition.

Instance type

The RDS instances can belong to the same instance family or different instance families. The instance families include the general-purpose instance family and the dedicated instance family.

Procedure

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane of the page that appears, click Backup and Restoration.

  3. Click Restore.

  4. In the Select Restore Method dialog box, select Restore to Existing Instance and click OK.

    Note

    This method is not supported for RDS instances that run SQL Server 2008 R2 with local disks.

  5. Configure the following parameters and click OK.

    Parameter

    Description

    Restore Mode

    • By Backup Set: allows you to restore data from a backup set.

    • By Time: allows you to restore the data to a point in time within the specified log retention period. For more information about how to view or change the log backup retention period, see Back up an ApsaraDB RDS for SQL Server instance.

    Restore Time

    This parameter appears only when you set the Restore Method parameter to By Time. Select the point in time to which you want to restore the data.

    Backup Set

    This parameter appears only when you set the Restore Method parameter to By Backup Set. Select the backup set from which you want to restore the data.

    More Backup Sets

    This parameter determines whether to display the most recent 1,000 backup sets. If you cannot find the required backup set from the Backup Set drop-down list, select this check box. Then, the system displays more backup sets for you to query.

    Destination Instance Name

    Select the destination RDS instance to which you want to restore the data. By default, the system displays all the RDS instances that are created within your Alibaba Cloud account and reside in the selected region. The displayed RDS instances include the original RDS instance whose data you want to restore.

    Note
    • If you use a snapshot backup file, you can restore the data only to an RDS instance on which the snapshot backup feature is enabled. For more information, see Use the snapshot backup feature.

    • The destination RDS instance can run a higher SQL Server version than the original RDS instance.

    • If the original RDS instance belongs to the shared instance family, you cannot restore the data of the instance to a general-purpose or dedicated RDS instance. Similarly, if the original RDS instance belongs to the general-purpose or dedicated instance family, you cannot restore the data of the instance to a shared RDS instance.

    • If a large number of RDS instances are displayed, you can enter a keyword in the Destination Instance Name field to search for the required destination RDS instance.

    Databases to Restore

    1. Select the databases that you want to restore. By default, the system displays and selects all the databases that are created on the original RDS instance.

      • If you want to restore all data of the original RDS instance, select all databases.

      • If you want to restore specific databases, select only the required databases.

    2. Specify the names that you want to use for the selected databases on the destination RDS instance. By default, the original names of the selected databases are retained.

      Note

      The names of the selected databases on the original RDS instance cannot be the same as those of the existing databases on the destination RDS instance.

    Note
    • If a selected database on the original RDS instance has the same name as an existing database on the destination RDS instance, you must specify the New Database Name parameter for the selected database.

    • The value of the New Database Name parameter can contain only lowercase letters, digits, underscores (_), and hyphens (-).

  6. Optional. View the progress of the restoration task.

    The system generates a restoration task. You can click the image.png icon in the upper-right corner of the page. On the Tasks page, search for the tasks whose Task Type is Clone Instance to view the restoration progress.

    image.png

Restore data to a new RDS instance

You can restore the data of your RDS instance to a new RDS instance from a backup set or to a specific point in time. If you restore the data from a backup set, you can restore some or all of the databases whose data is included in the backup set. For more information about the time that is required to restore an RDS instance to a new RDS instance, see FAQ.

Billing rules

You are charged for the new RDS instance. You can view the price of the new RDS instance when you create the instance.

Note
  • If you no longer require the original RDS instance after the restoration, we recommend that you release or unsubscribe from the instance at the earliest opportunity. For more information, see Release or unsubscribe from an ApsaraDB RDS for SQL Server instance.

  • You are immediately charged for the new RDS instance after the instance is created.

Procedure

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane of the page that appears, click Backup and Restoration.

  3. Click Restore.

  4. In the Select Restore Method dialog box, select Restore to New Instance and click OK.

    Note

    This method is not supported for RDS instances that run SQL Server 2008 R2 with local disks.

  5. On the Restore Instance page, configure the following parameters.

    Parameter

    Description

    Billing Method

    • Subscription: A subscription instance is an instance for which you pay an upfront fee. For long-term use, the subscription billing method is more cost-effective than the pay-as-you-go billing method. You are offered lower prices for longer subscription periods.

    • Pay-As-You-Go: A pay-as-you-go instance is billed per hour based on your actual resource usage. We recommend that you select the pay-as-you-go billing method for short-term use. If you no longer require a pay-as-you-go RDS instance, you can release it to reduce costs.

    Restoration Mode

    • By Backup Set: allows you to restore data from a backup set.

    • By Point in Time: allows you to restore the data to a point in time within the specified log retention period. For more information about how to view or change the log backup retention period, see Back up an ApsaraDB RDS for SQL Server instance.

    Database

    Specify whether to restore some or all of the databases that are created on the original RDS instance. If you select Some, you must manually enter the names of the databases that you want to restore and separate the database names with commas (,).

    Note

    If you enable the snapshot backup feature for the RDS instance, you can select only All. For more information, see Use the snapshot backup feature.

    Edition

    • Basic Edition: In RDS Basic Edition, the database system consists only of an RDS instance, and the computing is separated from storage. This RDS edition is cost-effective and suitable for learning or testing.

    • High-availability Edition: In RDS High-availability Edition, the database system consists of a primary RDS instance and a secondary RDS instance. These instances work in the high availability architecture. RDS High-availability Edition is suitable for production environments and is suitable for more than 80% of business scenarios.

    • Cluster Edition: In RDS Cluster Edition, the database system consists of a primary RDS instance, a secondary RDS instance, and up to seven read-only RDS instances. The read capability of the database system improves with the number of read-only RDS instances.

    Note

    The available RDS editions vary based on the region and database engine version that you select. For more information, see Overview.

    Zone of Primary Node

    Select a zone in which the RDS instance resides.

    Deployment Method

    • Multi-zone Deployment: The primary RDS instance and the secondary RDS instance reside in different zones to provide zone-disaster recovery. This is the recommended deployment method.

    • Single-zone Deployment: The RDS instance and the secondary RDS instance reside in the same zone.

    Note
    • No significant differences exist between the zones in the same region.

    • If the RDS instance resides in the same zone as the Elastic Compute Service (ECS) instance on which your application is deployed, these instances can deliver optimal performance. If the RDS instance and the ECS instance reside in different zones in the same region, the performance of the RDS instance and the ECS instance is slightly lower than the performance of the RDS instance and the ECS instance that reside in the same zone.

    • If you set the Edition parameter to Basic Edition, only the Single-zone Deployment method is available.

    • If Sold Out appears in the upper-right corner of a zone name, this zone does not have sufficient resources. In this case, you must switch to another zone.

    Zone of Secondary Node

    If you set the Deployment Method parameter to Multi-zone Deployment, you must select the zone in which the secondary RDS instance resides.

    Instance Type

    • General-purpose: entry-level instance type. A shared or general-purpose instance exclusively occupies the memory and I/O resources that are allocated. However, this type of instance shares CPU and storage resources with other general-purpose instances that are deployed on the same host.

    • Dedicated: enterprise-level instance type. You can select a dedicated instance type or a dedicated host instance type. A dedicated RDS instance exclusively occupies the CPU, memory, storage, and I/O resources that are allocated. The dedicated host instance family is the highest specifications of the dedicated instance family. A dedicated host instance occupies all the CPU, memory, storage, and I/O resources on the host on which the instance is deployed.

    Storage Capacity

    Configure the storage capacity for your RDS instance. The storage capacity is provisioned to store data files, system files, log files, and transaction files in the RDS instance. You can adjust the storage capacity at a step size of 5 GB.

    Note

    A dedicated RDS instance that uses local disks exclusively occupies the allocated resources, and its storage capacity varies based on the instance type. For more information, see Primary ApsaraDB RDS instance types.

  6. Click Next: Instance Configuration.

  7. Configure the following parameters.

    Parameter

    Description

    Network Type

    • Classic Network: the traditional type of network.

    • VPC: A virtual private cloud (VPC) is an isolated virtual network that provides higher security and higher performance than the classic network. If you set the Network Type parameter to VPC, you must also configure the VPC and vSwitch of Primary Node parameters.

    Note

    Make sure that the RDS instance and the ECS instance to be connected reside in the same VPC or in the classic network. Otherwise, they cannot communicate over an internal network.

    Resource Group

    The resource group to which the new RDS instance belongs.

  8. Click Next: Confirm Order.

  9. Confirm the settings in the Parameters section, configure the Purchase Plan and Duration parameters, read and select Terms of Service, click Pay Now, and then complete the payment. You must configure the Duration parameter only when the new RDS instance uses the subscription billing method.

    You can go to the Instances page and find the created RDS instance based on the creation time. It requires 1 to 10 minutes to create an RDS instance. You can refresh the page to check whether the RDS instance is created. After the RDS instance is created, you can access the RDS instance to view the restored databases and tables.

Restore the data to the original RDS instance by using a temporary RDS instance

This method is supported only for RDS instances that run SQL Server 2008 R2 and use local disks. For more information, see Restore the data of an ApsaraDB RDS for SQL Server instance by using a temporary RDS instance.

What to do next

  • You can also restore the data of an RDS instance by calling an API operation. For more information, see RecoveryDBInstance.

  • If you want to restore all data of an RDS instance, you can refer to this topic. ApsaraDB RDS for SQL Server does not support restoration of individual databases and tables. For more information about data restoration methods, see Methods to restore an ApsaraDB RDS for SQL Server instance.

FAQ

How much time is required to restore data to a new RDS instance?

Estimated time required for restoration

The following table describes the estimated time required to restore data to a new RDS instance. The speeds of data backup and restoration are estimated based on the size of uncompressed data.

Note

Backup compression is not supported for RDS instances that run SQL Server Web. This may slow down the speeds of data backup and restoration to less than 100 GB per hour.

Operation

Required

Estimated time

Description

Create and configure an RDS instance

Yes

10 to 15 minutes

The time required varies based on the product type and instance type of the new RDS instance that is used for data restoration.

Back up full data

No

200 GB per hour

  • If no full backups are performed on the RDS instance within 36 hours, a full backup is performed during the restoration process to balance the time required for data restoration from incremental transaction log backups and full backups.

    We recommend that you manually perform a full backup before data restoration or initiate a restoration task within 36 hours after the system automatically completes the full backup. This reduces the total amount of time required for restoration. For more information, see Back up an ApsaraDB RDS for SQL Server instance.

  • The backup speed may vary based on the region and time period.

  • To obtain more accurate information about backup and restoration performance, refer to the data volume and time for the last full backup.

Restore a full backup on the destination RDS instance

Yes

200 GB per hour

None

Back up incremental transaction logs on the source RDS instance

Yes

200 GB per hour

Before and after an incremental log backup, a time loss of 2 minutes may occur. The time loss may be caused by backup preparation, closure, and resource allocation.

Apply an incremental transaction log backup file to the destination RDS instance

Yes

200 GB per hour

Before and after an incremental log backup, a time loss of 2 minutes may occur. The time loss may be caused by backup consistency verification.

Restore a database

Yes

Within 2 minutes

  • Resource consumption: Applying an incremental transaction log backup file is a resource-intensive operation. If a large number of transaction logs are generated for an RDS instance that has small specifications, such as 2 CPU cores and 4 GB of memory, the data restoration speeds decreases.

  • Accelerated Database Recovery option: The Accelerated Database Recovery option is supported for RDS instances that run SQL Server 2019 or later. This reduces the time for database restoration. You can evaluate whether to enable the option based on official Microsoft documentation.

Example

Test instance: The RDS instance has 4 CPU cores and 8 GB of memory, and the volume of data on the RDS instance is 600 GB.

  • Time required to create and configure an RDS instance: approximately 12 minutes.

  • Time required to back up full data: approximately 3 hours. The time required is calculated by using the following calculation: Time required = 600 GB/200 GB per hour = 3 hours

  • Time required to restore a full backup on the destination RDS instance: approximately 3 hours. The time required is calculated by using the following calculation: Time required = 600 GB/200 GB per hour = 3 hours

  • Time required to back up incremental transaction logs on the source RDS instance: approximately 5 minutes. The time required is calculated by using the following calculation: Time required = 10 GB/200 GB per hour + Time loss of 2 minutes = 5 minutes

  • Time required to apply an incremental transaction log backup file to the destination RDS instance: approximately 5 minutes. The time required is calculated by using the following calculation: Time required = 10 GB/200 GB per hour + Time loss of 2 minutes = 5 minutes

  • Time required to restore a database: within 2 minutes

In this example, if no full backups are performed on the RDS instance within 36 hours, the total duration is estimated to be approximately 6 hours and 24 minutes. If a full backup is performed on the RDS instance within 36 hours, the duration is estimated to be approximately 3 hours and 24 minutes.

Restoration suggestions

  • Maintenance window: We recommend that you perform restoration operations during off-peak hours to minimize the impacts on your workloads.

  • Long-running transactions: During the restoration process, we recommend that you do not perform long-running transactions, such as creating or rebuilding indexes and archiving data. This helps prevents the time that is required to restore a database from being prolonged.