All Products
Search
Document Center

Back up a user-created Redis database and restore the backup data to an ApsaraDB for Redis database

Last Updated: Aug 28, 2020

Database Backup (DBS) allows you to back up user-created databases and restore the backup data to ApsaraDB databases. DBS supports a variety of databases, such as MySQL, SQL Server, PostgreSQL, Oracle, Redis, and MongoDB databases. This topic describes how to back up a user-created Redis database and restore the backup data to an ApsaraDB for Redis database.

Features

Feature Description Details
Parallel processing DBS supports a write capability of more than 150,000 transactions per second (TPS). Compared with redis-port, DBS provides a more than five times faster restore speed. View details
Single-database restoration DBS allows you to restore a single Redis database without restoring the entire Redis instance. This shortens the restore process. View details
Fine-grained backup DBS allows you to back up a single Redis database, multiple Redis databases at a time, or the entire Redis instance. View details
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. View details
Automatic storage classification DBS allows you to customize transfer and deletion rules for backup sets. View details
Backup source change DBS allows you to change the backup source of a backup schedule from a user-created Redis database to an ApsaraDB for Redis database. View details

Procedure

This topic describes how to back up a user-created Redis database and restore the backup data to an ApsaraDB for Redis database in three steps. You can follow the procedure based on your needs.

1. Back up a user-created Redis database

2. Restore the backup data to an ApsaraDB for Redis database

3. Change the backup source to an ApsaraDB for Redis database

1. Back up a user-created Redis database

(1) Create a DBS backup schedule
Go to the DBS purchase page and purchase a DBS backup schedule with the database type set to Redis.

(2) Configure the DBS backup schedule
Go to the DBS console. In the left-side navigation pane, click Backup Schedules. On the Backup Schedules page that appears, click Configure Backup Schedule in the Actions column of the created backup schedule.
6

(3) Configure the backup source
In the Configure Backup Schedule wizard, set Database Location to ECS-Hosted Database.
18

DBS allows you to back up and restore the following types of databases:

  • User-created databases connected to Alibaba Cloud through IP addresses and port numbers
  • User-created databases hosted on Elastic Compute Service (ECS) instances
  • ApsaraDB for Redis databases
  • User-created databases connected to Alibaba Cloud over Express Connect, VPN Gateway, or Smart Access Gateway

(4) Configure the backup destination
The backup destination is an Object Storage Service (OSS) bucket. DBS automatically generates the name of the OSS bucket. You can also enter a custom OSS bucket name.

(5) Select backup objects
DBS allows you to back up a single Redis database, multiple Redis databases at a time, or the entire Redis instance.
9

(6) Specify the backup time

DBS supports periodic backup and one-time backup. You can specify when to back up your database. You can back up your database on a weekly basis and at a specific time based on your business requirements. For example, you can perform a full backup at 03:00 during off-peak hours of your business. For databases that do not support incremental backup, the real-time transaction log backup feature is disabled and the options are dimmed.
To reduce the negative impact of backup operations on the performance of the database, DBS allows you to set the maximum number of concurrent threads and the highest speed allowed for full backup to limit the backup speed.

  • Maximum Concurrent Threads for Full Data Backup: the maximum number of concurrent threads allowed for full backup. A smaller value indicates a lower backup speed and a smaller impact on the performance of the source database.
  • Maximum Speed for Full Data Backup: the highest speed allowed for full backup. You can precisely control the speed of full backup to effectively reduce the negative impact of backup operations on single-thread performance of the Redis database.
    7

(7) Configure the lifecycle of backup sets

DBS allows you to manage the lifecycle of backup sets stored in OSS to reduce storage costs. You can configure transfer and deletion policies for all backup sets stored in OSS. As shown in the following figure, the maximum retention period of a full backup set is 730 days. The backup set will be deleted after it is stored for 730 days. A newly created backup set is first stored in OSS Standard storage for 180 days, and then transferred to OSS Infrequent Access (IA) storage. After another 365 days, the backup set is transferred to OSS Archive storage.

2. Restore the backup data to an ApsaraDB for Redis database

(1) Restore the database
After you back up the user-created Redis database, you can restore the backup data to an ApsaraDB for Redis database.
17

(2) Specify the time point to restore
DBS displays the time points to which the database can be restored in a calendar. You can quickly specify the time point to which the database will be restored. 5

(3) Configure the destination database
In this example, set Database Location to ApsaraDB for Redis.

(4) Select objects to restore
DBS allows you to only restore the selected single Redis database instead of the entire Redis instance. This significantly reduces the data to be restored and the recovery time objective (RTO).
16

(5) Start the restore task
DBS uses the parallel and batch processing technologies to restore the backup data. In core Redis scenarios where the average key size is 1 KB, the data is written at 150,000 TPS. Considering the network bandwidth limit of the destination Redis database, the restore speed can reach 50 Mbit/s.

3. Change the backup source to an ApsaraDB for Redis database

You can change the backup source from the user-created Redis database to an ApsaraDB for Redis database without releasing the backup schedule. This allows you to use more features such as data archiving and remote backup.

(1) Click Edit Backup Source.
17

(2) Set Database Location to ApsaraDB for Redis.
Database backup is fundamental to database O&M and requires long-term and stable operation. We recommend that you purchase DBS backup schedules that use the subscription billing method.

DBS provides the following schemes to meet different database management requirements on the cloud:

  • Cloud disaster recovery: You can use DBS to back up a database in an on-premises data center to Alibaba Cloud so that you can restore the backup data to a database in an on-premises data center or an ApsaraDB database.
  • Hybrid cloud backup: You can use DBS to back up both databases in on-premises data centers and ApsaraDB databases in a uniform manner.
  • Alibaba Cloud backup: You can use DBS to back up ApsaraDB databases so that you can use advanced features such as remote backup, long-term archiving, and real-time backup.