Backing Up and Restoring Databases with Alibaba Cloud Database Backup Service

By Kenny Lai, Solutions Architect

Alibaba Cloud Database Backup Service (DBS) is a secure and cost-efficient solution for continuous data protection. The service offers strong protection for data stored in multiple environments, such as enterprise data centers, hybrid clouds, public clouds, and third-party cloud vendors.

In this article, we will show you how to make use of the new Database Backup Service to perform database backup and restore process.

Prerequisites

You’ll need a workable database instance to use DBS. Your database instance can be an Elastic Compute Service (ECS) based database, an ApsaraDB for RDS instance, or even an on-premises or publicly accessible database instance. DBS Currently support MySQL, MongoDB, Oracle, and SQL Server database management systems.

Setting Up Backup Task

Locate Database Backup Service on your Alibaba Cloud console.

Image for post
Image for post

In the DBS Console, click Create Schedule

Image for post
Image for post

Select your preferred DBS Region, Database Type, Specification and Duration.

Image for post
Image for post

After confirming your selections, click Buy Now. Go back to the Database Backup Console and click on Backup Schedules. You will see an un-configured DBS instance listed.

Image for post
Image for post

Click Configure Backup and you will see the DBS configuration page.

Image for post
Image for post

Fill in all the necessary information including database location, database type, address, port, database account, password, and SSL encryption preferences. Optionally, you can test the connection and make sure the data you entered is correct. If your database is set behind a firewall, make use click the Set Whitelist to see the list of IP range needed to be whitelist so that DBS is able to reach your database.

In this example, we prepared a MySQL server running in ECS, so we select ECS-Hosted Database as the database location and we can locate the ECS instance ID via the dropdown list

Image for post
Image for post

He have configured our backup location to an OSS Bucket in Hong Kong.

Image for post
Image for post

Click Next and you will move to next step, which is to select the desired table/database needed to be included in the backup.

Image for post
Image for post

Click Select All to move all tables into selected list.

Image for post
Image for post

Click Next to move to configure backup time screen

Image for post
Image for post

DBS supports Single Backup or Periodic Backup modes. In this example, we have selected Single Backup.

Image for post
Image for post

Click Next to continue. Finally, we need to configure the backup retention policy.

Image for post
Image for post

Save the configuration and return to Backup Schedules page. To start the backup process, click Start to start the process.

When DBS begins the backup process, it will perform a pre-check first.

Image for post
Image for post

If there are no errors, click Start Task to execute the backup. The task will switch from “not started” to “running” status on your console. You can get an overview of the selected running task by clicking on Manage.

Image for post
Image for post
Image for post
Image for post

Click Backup Full Data to see the running task process.

Image for post
Image for post

Wait until the status changes to “Completed”. Once you see the Completed status, the backup is done.

Image for post
Image for post

You can click on View Backup Set to see the data that was backed up to OSS bucket.

Image for post
Image for post

Performing Database Restore

To Perform Database Restore, select the backup data to be used and select Restore Database.

Image for post
Image for post

We will see the Create Restore Task page. In this page, we need to define which restoration point to roll back to and the destination database information.

Image for post
Image for post
Image for post
Image for post

Click Next to proceed to the next step.

Image for post
Image for post

In the “Objects to Restore” step, you will first need to choose a conflict resolution option. You can choose to ask DBS to rename the existing database or fail when database table already exists. In this example, we have chosen to rename Object with the Same Name as we try to restore the backup into the source database.

Image for post
Image for post

Next, select the desired tables to restore. Once complete, click Pre-check to check if the database connection is fine or not.

Image for post
Image for post

DBS will check if the restoration task dependencies are met. If all statuses say “Successful”, click Start Task to begin the database restoration.

Task status will change from Initializing to Running to Completed. Wait until the task is completed.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

To view the details of the database restoration task, click on the task ID and click on Restore Schema. It will show the Create table DDL it executed. To view the number of rows restored, click Restore Full Data.

Image for post
Image for post
Image for post
Image for post

That’s it! Now you know how to use DBS to back up and restore your database.

To learn more about Alibaba Cloud Database Backup Service, visit https://www.alibabacloud.com/products/database-backup

Reference:https://www.alibabacloud.com/blog/backing-up-and-restoring-databases-with-alibaba-cloud-database-backup-service_594422?spm=a2c41.12541350.0.0

Written by

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store