All Products
Search
Document Center

Use DBS to back up a Redis database

Last Updated: Jul 28, 2020

Database Backup (DBS) supports backup and recovery for Redis instances and provides the features of single-table restoration, remote backup, full data backup, incremental backup, and long-term archiving.

Features

Feature Description
SQL file backup DBS uses the logical backup technology to store backup data in JSON files.
Backup data query DBS allows you to use SQL statements to query backup sets without restoring data. For more information, see Use SQL statements to query backup sets.
Remote backup DBS supports backing up a Redis instance to an Object Storage Service (OSS) bucket in the destination region, and restoring the backup data to a Redis instance in the destination region, source region, or any other regions.
Long-term archiving DBS supports retaining backup files for up to five years, after which the backup set will be automatically transferred to Archive Storage.
Fine-grained backup DBS supports backing up a single table, a single database, multiple databases, and an entire Redis instance.
Backup speed limit DBS allows you to limit the backup speed to significantly reduce the negative impact of backup operations on the performance of the database.
Single-table restoration DBS supports restoring a single table without restoring the entire Redis instance. This reduces the time required for data restore.

Create a backup schedule

  1. Log on to the DBS console.
  2. Click Create Schedule in the upper-right corner to go to the DBS buy page.
  3. Set the parameters as described in the following table and click Buy Now.

    Section Parameter Description
    Basic DBS Region The region where the DBS instance to be purchased resides.
    Make sure that the selected region is the same as the region where you want to store the backup data.
    Database Type The type of the database to be backed up. In this topic, select PostgreSQL.
    Specification The specification of the DBS instance to be purchased. For more information, see How to select DBS instances.
    Backup Method The mode for backing up data. Only logical backup is supported for backing up Redis instances.
    Storage Size The storage size of the DBS instance to be purchased. You do not need to specify the storage size when you purchase a DBS instance. The instance is charged in the pay-as-you-go mode. You can also purchase a storage package. A favorable discount is available if you purchase a large storage package.
    Purchase Plan Quantity The number of DBS instances to be purchased. Set this parameter based on your actual needs.
    Duration The validity period of the purchased DBS instance. Set this parameter based on your actual needs.
  4. On the Confirm Order page, confirm your order information, read and accept the DBS (Subscription) Agreement of Service, and then click Pay.

  5. After you pay for the order, log on to the DBS console and click Backup Schedules in the left-side navigation pane to view the new backup schedule.

Configure the backup schedule

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Schedules.
  3. On the Backup Schedules page that appears, find the target backup schedule and click Configure Backup Schedule in the Actions column.p2

  4. In the Configure Backup Source and Destination step, configure the backup source and destination.

    Section Parameter Description
    None Schedule Name The name of the backup schedule. DBS automatically generates a schedule name. We recommend that you specify an informative name for easy identification. You do not need to use a unique schedule name.
    Backup Source Information Backup Mode The mode for backing up data. Only logical backup is supported for backing up Redis instances.
    Database Location The location of the database to be backed up. Valid values:
    • User-Created Database with Public IP Address
    • ECS-Hosted Database
    • ApsaraDB for Redis
    • Express Connect DB/VPN Gateway/Intelligent Gateway
    • No public network IP: Port’s self-built database (accessed through the database gateway)
    Database Type The type of the database to be backed up. In this example, this parameter is set to Redis.
    Instance Region The region where the database to be backed up resides.
    This parameter is available only when you set Database Location to ECS-Hosted Database, ApsaraDB for Redis, or No public network IP: Port’s self-built database (accessed through the database gateway).
    Address The public endpoint used to connect to the database to be backed up.
    This parameter is available only when you set Database Location to User-Created Database with Public IP Address , Express Connect DB/VPN Gateway/Intelligent Gateway, or No public network IP: Port’s self-built database (accessed through the database gateway).
    Port Number The port used to connect to the database to be backed up.
    If you set Database Location to ApsaraDB for Redis, this parameter is unavailable.
    ECS Instance ID The ID of the ECS instance where the database to be backed up resides.
    This parameter is available only when you set Database Location to ECS-Hosted Database.
    Redis Instance ID The ID of the ApsaraDB for Redis instance to be backed up.
    This parameter is available only when you set Database Location to ApsaraDB for Redis.
    Peer VPC The virtual private cloud (VPC) where the database to be backed up resides.
    This parameter is available only when you set Database Location to Express Connect DB/VPN Gateway/Intelligent Gateway.
    Database gateway instance ID The ID of the database gateway instance.
    This parameter is available only when you set Database Location to No public network IP: Port’s self-built database (accessed through the database gateway).
    Password The password of the account used to connect to the database to be backed up.
    After you enter the database account and password, click Test Connection next to Password to check whether the information about the database to be backed up is correct. If the specified parameters are valid, the Test Passed message appears. If the Test Failed message appears, click Check next to Test Failed. Modify the information about the database to be backed up based on the check results.
    Backup Destination Information Backup Storage Type The type of the storage used to store backup data. Valid values:
    • DBS built-in storage (recommended)
    • OSS for user
    OSS Bucket Name The name of the OSS bucket.
    This parameter is available only when you set Backup Storage Type to OSS for user.
    Storage Encryption The method used to encrypt the stored data. Valid values:
    • Non-encrypted
    • Encrypted
    • KMS Encrypted

    p3

  5. In the lower-right corner of the page, click Next.

  6. In the Edit Backup Objects step, find the database or table to be backed up in the Available section, click the rightwards arrow to add the selected database or table to the Selected section, and then click Next.

    If you back up an entire database, permission data and stored procedures will also be backed up.

  7. In the Configure Backup Time step, set the parameters as described in the following table and click Next.

    Parameter Description
    Full-scale Backup Frequency The frequency of the backup schedule. Valid values: Periodic Backup and Single Backup.
    Full Data Backup Recurrence The day in a week on which DBS runs the backup schedule.
    Full Data Backup Start At The start time of the backup.
    If the time taken for a full data backup is longer than the backup interval, DBS skips the next backup.
    Real-Time Transaction Log Backup Specifies whether to enable incremental backup.
    Maximum Concurrent Threads for Full Data Backup The maximum number of concurrent threads available for a full data backup.
    The value varies with the specifications of the DBS instance that you purchased when you created the backup schedule.
    Maximum Speed for Full Data Backup The maximum speed of concurrent threads for a full data backup.
  8. In the Edit Lifecycle step, configure the lifecycle for a full data backup in the Configure Full Data Backup Lifecycle section.

  9. After the configuration is complete, click Precheck in the lower-right corner of the page.

  10. If the Precheck Passed message appears, click Start Task.
    p4

  11. When the status of the backup schedule changes to Running, the backup schedule takes effect.

View the backup schedule

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Schedules.
  3. On the Backup Schedules page, find the target backup schedule and click Manage in the Actions column.
  4. On the Configure Task page, view the basic information and running status of the backup schedule.
  5. To view all full backup information, choose Backup Tasks > Full Data in the left-side navigation pane. To view all incremental backup information, choose Backup Tasks > Transaction Logs in the left-side navigation pane.

Restore a Redis instance

  1. Log on to the DBS console.

  2. In the left-side navigation pane, click Backup Schedules.

  3. On the Backup Schedules page, find the target backup schedule and click Manage in the Actions column.

  4. On the Configure Task page, click Restore Database in the upper-right corner.

  5. In the Set Time Restored To step in the Create Restore Task wizard, set the parameters as described in the following table and click Next.

    Section Parameter Description
    - Task Name The name of the restore task. DBS automatically generates a task name. We recommend that you specify an informative name for easy identification. You do not need to use a unique task name.
    Set Time Restored To Time Range Available to Restore The time range available for restoring backup sets. DBS displays the available time range automatically.
    Restore To The time point that you want to restore the source instance to. The value must be within the time range specified by Time Range Available to Restore.
    Configure Destination Database Database Location The location of the database to be restored. Valid values:
    • User-Created Database with Public IP Address
    • ECS-Hosted Database
    • ApsaraDB for Redis
    • Express Connect DB/VPN Gateway/Intelligent Gateway
    • No public network IP: Port’s self-built database (accessed through the database gateway)
    Database Type The type of the database to be restored. In this example, this parameter is set to Redis.
    Instance Region The region where the database to be restored resides.
    This parameter is available only when you set Database Location to ECS-Hosted Database, ApsaraDB for Redis, or No public network IP: Port’s self-built database (accessed through the database gateway).
    Address The public endpoint used to connect to the database to be restored.
    This parameter is available only when you set Database Location to User-Created Database with Public IP Address , Express Connect DB/VPN Gateway/Intelligent Gateway, or No public network IP: Port’s self-built database (accessed through the database gateway).
    Port Number The port used to connect to the database to be restored.
    If you set Database Location to ApsaraDB for Redis, this parameter is unavailable.
    ECS Instance ID The ID of the ECS instance where the database to be restored resides.
    This parameter is available only when you set Database Location to ECS-Hosted Database.
    Redis Instance ID The ID of the ApsaraDB for Redis instance to be restored.
    This parameter is available only when you set Database Location to ApsaraDB for Redis.
    Peer VPC The virtual private cloud (VPC) where the database to be restored resides.
    This parameter is available only when you set Database Location to Express Connect DB/VPN Gateway/Intelligent Gateway.
    Database gateway instance ID The ID of the database gateway instance.
    This parameter is available only when you set Database Location to No public network IP: Port’s self-built database (accessed through the database gateway).
    Password The password of the account used to connect to the database to be restored.
    After you enter the database account and password, click Test Connection next to Password to check whether the information about the database to be restored is correct. If the specified parameters are valid, the Test Passed message appears. If the Test Failed message appears, click Check next to Test Failed. Modify the information about the database to be restored based on the check results.

    p4

  6. In the Configure Objects to Restore step, find the database or table to be restored in the Available section, click the rightwards arrow to add the selected database or table to the Selected section, and then click Precheck.

  7. If the Precheck Passed message appears, click Start Task.