Restore SQL Server data

更新时间:
复制 MD 格式

If you have a backup of an RDS SQL Server instance, you can restore the data to an existing instance or a new one. This is useful for recovering from operational errors or analyzing historical data.

Note

This topic describes how to restore data to an instance in the same region. To restore data across regions or restore RDS backup files to a self-managed database, see Overview of restoration solutions to select an appropriate method.

Limitations

  • If an instance is in the simple recovery model, it does not back up transaction logs. Therefore, you can only restore data from a backup set and cannot perform a point-in-time recovery.

  • When restoring from a backup set, you cannot restore an instance in the simple recovery model to a High-Availability Edition, shared-specification, or Cluster Edition instance.

  • If an instance has the Data Archiving to OSS feature enabled, you can restore only the databases in the backup set that are not in cold storage. If a database is moved to cold storage, the restored instance does not include that database.

  • Backups of a Serverless instance can only be restored to a new Serverless instance, not an existing one.

  • Direct restoration is not supported for RDS SQL Server 2008 R2 instances that use high-performance local disks. To restore data from this instance version, you must use a temporary instance.

  • If TDE is enabled, backups can only be restored to a new instance.

Restore to an existing instance

You can restore a backup of an instance to a specified existing instance, including the source instance. You can restore from a backup set or to a specific point in time. You can restore all databases or a subset.

Restoration rules

Requirement

Description

Database version

The database version of the destination instance must be the same as or later than the version of the source instance.

Instance series

You cannot restore an instance of a higher series to a lower series. The series are ordered from highest to lowest: Cluster Edition > High-Availability Edition > Basic Edition.

Instance type

You can restore an instance only to another of the same type, or between General-purpose and Dedicated types.

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 navigation pane on the left, click Backup and Restoration, and then click Restore Database.

  3. In the dialog box that appears, select Restore to Existing Instance and click OK.

  4. Configure the following parameters, and then click OK.

    Parameter

    Description

    Restore Method

    • By Backup Set: Restores data from the selected backup set.

    • By Time: Restores the instance to a specific point in time within the log backup retention period. The system uses the most recent full backup and subsequent incremental backups to perform the restoration. You cannot restore from a specific incremental backup. You can view or modify the log backup retention period as needed.

    Restoration Time

    This parameter is visible when Restore Mode is set to By Time. Select the point in time to which you want to restore.

    Backup Set

    This parameter is visible when Restore Mode is set to By Backup Set. Select the backup set to restore.

    More Backup Sets

    If the target backup set is not listed in the Backup Set dropdown, select this option to search for more.

    Destination Instance Name

    Select the destination instance for the restoration. You can restore to an instance with a later database version. By default, the system lists all instances in the current region under your account, including the source instance.

    Note
    • A snapshot backup can only be restored to an instance that has snapshot backup enabled.

    • You cannot restore backups between shared-specification instances and General-purpose or Dedicated instances.

    • If too many destination instances are displayed, use the search box to filter the list.

    Databases to Restore

    1. Select the databases to restore. You can restore some or all databases. By default, all databases in the instance are listed.

    2. Set the names for the restored databases. By default, the original database names are used. Important:

      • The restored database name must be unique on the destination instance. Duplicate names will cause the restoration to fail.

      • If you provide a unique name for the restored database, a new database is created without affecting existing data on the destination instance.

      • Restored database names can contain only uppercase letters, lowercase letters, digits, underscores (_), and hyphens (-).

  5. Monitor the restoration progress.

    The system creates a restoration task. Click Tasks in the upper-right corner. On the Tasks page, filter the tasks by Task Type and select Clone Instance to view the progress.

    The restoration is complete when the Task Status is Succeeded and the Progress is 100%.

Restore to a new instance

You can restore a backup of an instance to a new instance from a backup set or to a specific point in time. The restoration can include all databases or a subset of databases. For information about the time required to restore to a new instance, see FAQ in this topic.

Billing

Restoring data to a new instance creates a billable instance. You can review the fees during the creation process.

Note

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 navigation pane on the left, click Backup and Restoration, and then click Restore Database.

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

  4. On the Restore Database page, configure the following parameters.

    Category

    Description

    Billing method

    • Subscription : A prepaid method where you pay upfront. This is suitable for long-term needs and is more cost-effective than pay-as-you-go. The longer the subscription period, the greater the discount.

    • Pay-As-You-Go: A postpaid method where you are billed hourly. This is suitable for short-term needs. You can release the instance at any time to save costs.

    Restore Mode

    • By Backup Set: Restores data from the selected backup set.

    • By Time: Restores the instance to a specific point in time within the log backup retention period. The system uses the most recent full backup and subsequent incremental backups to perform the restoration. You cannot restore from a specific incremental backup. You can view or modify the log backup retention period as needed.

    Database

    You can restore all or some databases. When you select Part, you must manually enter the database names and separate them with a comma (,).

    Note

    If snapshot backup is enabled for an instance, you can restore only All databases. You cannot restore Part databases.

    Edition

    The available series vary by region and database version. The available options are shown in the console. For more information, see Supported series.

    Storage Type

    Select an ESSD cloud disk or a high-performance cloud disk. For more information, see Storage types.

    Zone of Primary Node

    Select the zone for the primary node of the instance.

    Note

    Basic Edition instances have only one node and therefore exist in a single zone.

    Deployment Method

    • Multi-zone Deployment (Recommended): The primary and secondary nodes are in different zones within the same region to provide cross-zone disaster recovery.

    • Single-zone Deployment: The primary and secondary nodes are in the same zone.

    Note
    • There is no significant difference between zones in the same region.

    • For optimal performance, create your ECS and RDS instances in the same zone. The performance impact is minimal if they are in different zones within the same region.

    • If you select the Basic Edition, only Single-zone Deployment is supported.

    • If a zone is marked as Sold Out, select another zone.

    • Basic Edition does not support this parameter.

    Zone of Secondary Node

    If you set the Deployment Method to Multi-zone Deployment, you must select the zone for the secondary instance node.

    Note

    Basic Edition instances have only one node and therefore do not have a secondary node zone.

    Instance Type

    The available instance types vary by region and database version. The available options are shown in the console. For more information, see Supported instance types.

    Capacity

    The new instance's storage capacity must be greater than or equal to that of the source instance.

    • You can view the storage capacity of the source instance on its Basic Information page.

    • Storage capacity includes space for data, system files, log files, and transaction files.

  5. Click Next: Instance configuration and configure the following parameters.

    Category

    Description

    Network Type

    Currently, only VPC is supported. You can create a VPC and a vSwitch as needed.

    Note

    Ensure that the RDS instance and the ECS instance that needs to connect to it are in the same VPC. Otherwise, they cannot communicate over the internal network.

    Resource Group

    The resource group to which the instance belongs. You can create a resource group if needed.

  6. Click Next: Confirm order.

  7. Confirm the Parameter Configuration. Select the Quantity and Duration (for subscription instances only). Then, click Pay Now and complete the payment.

    It takes 1 to 10 minutes to create the instance. Go to the instance list and refresh the page to see the new instance.

  8. After the instance is created, connect to the new SQL Server instance to verify the restored data.

Related operations

You can also restore data by using the RecoveryDBInstance API.

FAQ

How long does it take to restore data to a new instance?

Estimated time

The following table provides an estimated time range for restoring data to a new instance. Note that all backup and restore speeds are based on the uncompressed data size.

Note

The Web Edition does not support backup compression, which reduces backup efficiency. This may cause backup and restore speeds to drop below 100 GB/hour.

Actions

Required

Estimated time

Notes

Create and configure the new instance

Required

10–15 minutes

The time required depends on the series and instance type you select for the new instance.

Perform a full backup of the source instance

Optional

200 GB/hour

  • The recovery speed for transaction logs is much slower than for a full backup. To ensure optimal restore efficiency, the system initiates a full backup if one has not been performed in the last 36 hours. This balances the need for faster recovery against the overhead of an extra full backup.

    We recommend that you manually perform a full backup before restoration, or start the restore task within 36 hours after an automatic full backup completes. This reduces the total restoration time.

  • The backup speed may vary by region and time of day.

  • For a more accurate estimate, check the data volume and time of your most recent full backup.

Restore the full backup to the destination instance

Required

200 GB/hour

None

Back up incremental transaction logs on the source instance

Required

200 GB/hour

An additional 2-minute overhead may occur for tasks such as backup preparation, finalization, and resource allocation.

Apply incremental transaction log backups on the destination instance

Required

200 GB/hour

An additional 2-minute overhead may occur for tasks such as backup consistency verification.

Bring the database online

Required

Typically within 2 minutes

  • Resource consumption: Applying incremental transaction logs is a resource-intensive operation. For instances with lower specifications (for example, 2-core 4 GB), a large number of transaction logs can slow down the recovery speed.

  • Accelerated Database Recovery: RDS for SQL Server 2019 and later versions offer the Accelerated Database Recovery (ADR) feature, which can reduce the time required to bring the database online. See the Microsoft documentation for more details.

Example estimation

Test instance specifications: 4-core 8 GB CPU and memory, 600 GB of data.

  • Create and configure the new instance: 12 minutes

  • Perform a full backup (Optional): 3 hours (600 GB / 200 GB per hour)

  • Restore the full backup to the destination instance: 3 hours (600 GB / 200 GB per hour)

  • Back up 10 GB of incremental transaction logs on the source instance: 5 minutes (3 minutes for backup + 2 minutes overhead)

  • Apply 10 GB of incremental transaction log backups on the destination instance: 5 minutes (3 minutes for applying + 2 minutes overhead)

  • Bring the database online: Within 2 minutes

In this example, if a full backup has not been performed within the last 36 hours, the total time is approximately 6 hours and 24 minutes. Otherwise, the total time is approximately 3 hours and 24 minutes.

Recommendations

  • Plan a maintenance window: Perform the restore operation during off-peak hours to minimize the impact on your business.

  • Avoid long-running transactions: During the restoration process, avoid long-running transactions such as creating or rebuilding indexes or archiving data. These operations can extend the time required to bring the database online.