×
Community Blog How to Backup MongoDB Data with ApsaraDB for MongoDB

How to Backup MongoDB Data with ApsaraDB for MongoDB

In this article, you will get some information on how to backup data with ApsaraDB for MongoDB, MongoDB replica set and data replication platform, and how to recover the backup MongoDB data.

ApsaraDB for MongoDB automatically backs up data according to the default backup policy. You can also set a backup policy based on business requirements to automatically back up data for your ApsaraDB for MongoDB instances as required.

Set an automatic backup policy

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the upper-left corner of the home page, select the region where the target instance is located.
  3. In the left-side navigation pane, click Replica Set Instances or Sharding Instances based on the architecture of the target instance.
  4. Locate the target instance and click its instance ID.
  5. In the left-side navigation pane, click Backup and Recovery.
  6. Click Backup Settings.
  7. In the Backup Settings dialog box that appears, set related parameters.
  8. After setting the preceding parameters, click OK.

Manually back up ApsaraDB for MongoDB data

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the upper-left corner of the home page, select the region where the target instance is located.
  3. In the left-side navigation pane, click Replica Set Instances or Sharding Instances based on the architecture of the target instance.
  4. Locate the target instance and click its instance ID.
  5. In the left-side navigation pane, click Backup and Recovery. In the upper-right corner of the page that appears, click Backup Instance.
  6. In the Backup Instance dialog box that appears, select a backup method for Backup Method.
  7. Click OK.

Related Blog Posts

How Should I Backup MongoDB Databases?

MongoDB replica set is composed of a group of MongoDB instances (processes), including one primary node and multiple secondary nodes. All the data on the MongoDB Driver (client) is written to the primary node, and the secondary node synchronizes the written data from the primary node to ensure that all the members in the replica set store the same datasets to achieve high availability of data.

The figure below (contributed by the official documents of MongoDB) shows a typical MongoDB replica set including a primary node and two secondary nodes.

Because the hidden node will not accept requests from the Driver, you can use the hidden node for data backup, offline computing, and other tasks without affecting the service provided by the replica set.

MongoShake – A MongoDB-based Cross-Data Center Data Replication Platform

In the current database ecosystem, most database systems support data synchronization among multiple node instances such as MySQL Master/Slave synchronization and Redis AOF master/slave synchronization. MongoDB even supports replica set synchronization among three or more nodes; this solidly ensures the high availability of a logical unit's data redundancy.

Note that data backup is MongoShake's core function, but data backup is not its only function. Using MongoShake as a platform service, you can meet your needs in different business scenarios by means of data subscription and consumption.

Related Tutorials

Migrating and Backing up Databases with Alibaba Cloud ApsaraDB for MongoDB

In this tutorial, we’ll show you how to get started with Alibaba Cloud ApsaraDB for MongoDB. In particular, we will be exploring how to create, migrate, and back up database files with Alibaba Cloud ApsaraDB for MongoDB.

Getting Started with the ApsaraDB Stack and Backups

Creating regular backups is a vital part of managing a database server, whether it's cloud-based or running on your own premises. It may be that your application already handles this by automatically retrieving its key data from the database server and creating backup files at regular intervals. If this is not the case, you will need to create and manage your backups as part of the process of running an ApsaraDB for RDS instance.

ApsaraDB for RDS includes an automatic backup system as standard, and it's important that you configure this to ensure that your data is being backed up at suitable times.

Backing up databases is not always as straightforward as backing up document files, as one or more applications might be updating the database at the time it's being backed up. If an update involves amending more than one table in the database, and if the backup takes place before all updates are complete, the backup will not be reliable.

This tutorial will cover how to get started with the ApsaraDB Stack and how to ensure your data is backed up, including both automatic and manual backups and covering how to access your data from the backup, if case problems do occur.

Related Documentation

Recover ApsaraDB for MongoDB physical backup data in a user-created MongoDB instance

You can log on to the ApsaraDB for MongoDB console to download a physical backup file from an ApsaraDB for MongoDB instance. This topic describes how to recover ApsaraDB for MongoDB physical backup data in a user-created MongoDB instance.

Recover logical backup data in a user-created MongoDB instance

Replica set and sharded cluster instances support logical backup. You can start a full logical backup to back up instance data and download the logical backup file. Then, you can run a mongorestore command to recover the downloaded backup data in a user-created MongoDB instance.

Database Celebration Offers

Alibaba Cloud Database Service has been recognized as A Strong Performer by Forrester. To celebrate the achievement and progress made by Alibaba Cloud database, we are now giving out attractive offers exclusively for our customers. Please refer to the Terms and Conditions section for details and rules of the offers.

0 0 0
Share on

Alibaba Clouder

2,599 posts | 762 followers

You may also like

Comments