Help Center> Data Replication Service> Backup Migration> Creating a Backup Using OBS Buckets
Updated on 2022-09-21 GMT+08:00

Creating a Backup Using OBS Buckets

Supported Source and Destination Databases

Table 1 Supported databases

Backup File

Destination DB

On-premises and other cloud's Microsoft SQL Server backup file versions:

  • Microsoft SQL Server 2000
  • Microsoft SQL Server 2005
  • Microsoft SQL Server 2008
  • Microsoft SQL Server 2012
  • Microsoft SQL Server 2014
  • Microsoft SQL Server 2016
  • Microsoft SQL Server 2017
  • Microsoft SQL Server 2019

RDS for Microsoft SQL Server

  • Microsoft SQL Server 2008
  • Microsoft SQL Server 2012
  • Microsoft SQL Server 2014
  • Microsoft SQL Server 2016
  • Microsoft SQL Server 2017
  • Microsoft SQL Server 2019

Prerequisites

  • You have logged in to the DRS console.
  • Your account balance is greater than or equal to $0 USD.
  • For details about the supported DB types and versions, see Supported Databases.
  • If a subaccount is used to create a DRS task, ensure that an agency has been added. To create an agency, see Agency Management.

Before Backing Up File

Learn the backup migration constraints before starting a migration task.

Table 2 Before Backing Up File

Scenario

Preparations

OBS bucket

  • An OBS bucket is available. If there is no OBS bucket, create one. For detailed operations, see "Creating a Bucket" in the Object Storage Service Console Operation Guide.
  • Database backup files have been uploaded to the OBS bucket. If there are no backup files in the OBS bucket, upload local backup files to it and ensure that the backup file name format is correct. For details about how to upload backup files, see "Uploading a File or Folder" in Object Storage Service Console Operation Guide.
  • OBS Browser has been installed for uploading multiple files in batches or large files greater than 50 MB in size. For detailed operations, see the Introduction to OBS Browser.
NOTE:
  • Currently, KMS encryption is not available when you upload backup files to an OBS bucket.
  • When you upload backup files to an OBS bucket, select Standard for Storage Class. Otherwise, the migration will fail.
  • If the number of data records in a bucket exceeds 500, data overflow may occur. As a result, some data cannot be displayed. You can use an independent standard bucket with the public-read permission.
  • You are advised to store backup files in independent OBS buckets in the same region as the destination DB instance.

Precautions

This section describes constraints on backup migrations of Microsoft SQL Server databases.

Table 3 Precautions

Type

Restrictions

Database permissions

Before creating a backup migration task, ensure that the current account has the OBS and bucket permissions.

Backup database names

  • Backup database names are case-insensitive, must be unique, and cannot be any of the following:
    • msdb
    • master
    • model
    • tempdb
    • rdsadmin
    • resource
  • The name of the OBS bucket contains 1 to 256 characters, including letters, digits, underscores (_), and hyphens (-).

New database name

  • The new database name must be unique and cannot be any of the following (case-insensitive):
    • msdb
    • master
    • model
    • tempdb
    • rdsadmin
    • resource
  • The new database name contains 1 to 128 characters, including letters, digits, underscores (_), and hyphens (-).

Local backup files

  • The suffix of the backup file to be uploaded to an OBS bucket must be .bak. Only .bak files can be selected in the OBS backup file list.
  • The backup file name contains 1 to 200 characters.
  • The backup file name can contain only letters, digits, hyphens (-), and underscores (_).
  • Backup files are classified into full backup files and log backup files.

Backup file sources

  • OBS buckets: store local backup files in its root directory.

Precautions

  • The OBS bucket and DB instance must be in the same region.
  • The available disk space of the destination database is at least 1.5 times the total data size of the backup database.
  • Backup database name is case-sensitive and must be the same as the database name in the backup file.
  • The database backup file from a database of later version cannot be restored on the instance database of an earlier version (for example, restored from version 2017 to 2016).
  • The restoration from Enterprise Edition to Standard Edition to Web Edition may fail. That depends on whether the features of the later version are enabled.
  • During a migration, if Overwrite Data is set to Yes, high availability of the destination database is disabled by default. After the migration is complete, high availability is restored automatically.
  • During a migration, stop writing transactions to the destination database.
  • If a primary/standby switchover of the destination database is performed, the backup migration fails. In this case, the migration task cannot be restored.

Procedure

This section describes how to create a backup migration task using the backup stored in the OBS bucket on the DRS console.

  1. On the Backup Migration Management page, click Create Migration Task.
  2. On the Select Backup page, specify information about the task and backup files. Then, click Next.

    Figure 1 Task information
    Table 4 Task information

    Parameter

    Description

    Task Name

    The task name consists of 4 to 50 characters, starts with a letter, and can contain only letters (case-insensitive), digits, hyphens (-), and underscores (_).

    Description

    The description consists of a maximum of 256 characters and cannot contain special characters !=<>'&"\

    Figure 2 Backup file information
    Table 5 Backup file information

    Parameter

    Description

    Database Type

    Database type of the backup file. Select Microsoft SQL Server.

    Backup File Source

    Select OBS Bucket.

    Bucket Name

    Select a bucket and a backup file stored in the directory of the bucket.

    NOTE:
    • The backup file of the Microsoft SQL Server must be named in the .bak format in the OBS bucket directory. Multiple backup files can be selected at the same time.
    • A database cannot be split into different files for upload.
    • The bucket name, backup file name, or path cannot contain full-width characters.

    Enterprise Project

    If the DB instance has been associated with an enterprise project, select the target project from the Enterprise Project drop-down list.

    You can also go to the ProjectMan console to create a project. For details about how to create a project, see the ProjectMan User Guide.

    Tags

    • Tags a task. This configuration is optional. Adding tags helps you better identify and manage your tasks. Each task can have up to 10 tags.
    • After a task is created, you can view its tag details on the Tags tab. For details, see Tag Management.

  3. On the Select Destination page, specify database information and click Next.

    Figure 3 Microsoft SQL Server database information
    Table 6 Microsoft SQL Server database information

    Parameter

    Description

    Destination RDS DB Instance Name

    Select a destination RDS DB instance. If no RDS DB instance is available, you can create one.

    Backup File Format

    Select Full or Incremental.

    • Full: indicates full backup files.
    • Incremental: indicates log backup files.
      NOTE:
      • Before performing an incremental restoration, you need to perform a full restoration.
      • To migrate databases at a time, you need to stop services first and upload full backups for restoration.
      • To ensure service continuity during a migration, perform a full backup and multiple incremental backups, and then upload the backup data to OBS for restoration.

    Last Backup

    A complete restoration involves restoring several incremental backup files. The destination DB instance cannot be modified while it is being restored. It will not be available until the last backup file is restored. If you select Yes and restore the instance, any incremental restoration will not be performed. You can select the last backup in the following scenarios:

    • Perform a one-time full migration.
    • The selected backup file is the last one to be restored.

    Overwrite Data

    You can determine whether to overwrite data in the destination database during the restoration if the destination DB instance contains a database with the same name as the backup database. Exercise caution when performing this operation.

    NOTE:

    If you select this option, the destination databases with the same names as the backup databases will be overwritten. Exercise caution when performing this operation.

    Perform Pre-verification

    Specifies whether to perform pre-verification on the backup migration task. The default value is Yes.

    • Yes: To ensure successful migration and identify potential problems in advance, verify the validity, integrity, continuity, and version compatibility of backup files before restoration.
    • No: If pre-verification is not performed, the migration speed is faster, but you need to check the validity, integrity, continuity, and version compatibility of backup files on your own.

    Restore Database

    You can restore all or part of databases. All of databases are restored by default.

    • All: Restore all databases from the backup file. You do not need to enter the name of the database to be restored.
    • Custom: Restore specified databases from the backup file. You need to enter the names of the databases to be restored. The databases to be restored must be consistent with those for which the full or incremental backups are created.

    Reset Database Name

    If Restore Database is set to All, you can reset database names. If you enable Reset Database Name, the original database names in the backup file will be reset to new database names.

    Constraint:

    • The backup file contains only one database.
    • The backup file is a full backup file and is the last backup file. Select Full for Backup File and Yes for Last Backup Type.
    NOTE:

    The database name can be reset only when Backup Type is set to Full and Restore Database is set to All.

    Backup Database Name

    If Restore Database is set to Custom, you need to specify Backup Database Name.

    The backup database name must be the same as that in the backup file and consist of 1 to 256 characters. It can contain only letters (case-sensitive), digits, hyphens (-), and underscores (_).

    DRS also allows you to create an alias for the database to be restored.

    • If you choose to restore databases in full backup mode, you can set the alias of the database based on the site requirements. The alias is also stored in the destination database.
    • If databases are restored in incremental backup mode, alias is not supported.
    NOTE:

    The backup database can be renamed. Up to 100 backup databases can be created.

  4. On the Confirm Task page, check configuration details, read and agree to the agreement, and click Next.

    If the SQL Server source contains non-clustered index tables, the index information of non-clustered index tables will become invalid after the SQL Server backups are restored to a new database. For the best performance, rebuild the indexes after the backup migration. In addition, the backup files store only database-level information. If the SQL Server source contains some instance-level configurations, such as login, permission, DBlink, and job, migrate these configurations by referring to Manual Configuration.

  5. In the task list on the Backup Migration Management page, check whether the task is in the Restoring status. If the migration is successful, the task status becomes Successful.