You need to enable JavaScript to run this app.
Document Database for MongoDB

Document Database for MongoDB

Copy page
Download PDF
Data recovery
Recovery from backup files
Copy page
Download PDF
Recovery from backup files
Document Database for MongoDB supports restoring instance data to a new instance based on the specified backup file.​
Prerequisite​
  • The original instance must be in Running or Restoring status. For more details, refer to Instance status.​
  • The original instance must have at least one available data backup file.​
Limits​
  • Currently, only replica set instances support this feature; sharding cluster instances do not.​
  • Currently, only restoring to a new instance using specified backup file is supported; restoring to original instance is not supported.​
  • Document Database for MongoDB does not support restoring time series collections. Therefore, if there is time series data in the original instance, data inconsistency may occur after restoring to a new instance.​
Procedure​
  1. Log in to the MongoDB console.​
  1. In the upper-left corner of the top menu bar, select the project and region for instance.​
  1. On the Replica set instances page find the target instance, click the instance name.​
  1. On the instance details page, click the Backups tab.​
  1. In the list of backup files under the Full backup sub-tab, locate the backup file to be recovered. In the Actions column on the right, select ... > Restore to new instance.​
  1. On the Recovery instance page, confirm the configuration details of the source instance, such as the instance type and instance specification, and configure the following parameters.​
  • ​
    Parameter​
    ​
    Description​
    Basic information​
    Instance name​
    The original instance name is used by default. You can also set a new name for the recovered instance. The name must meet the following requirements:​
    • It cannot start with a number or hyphen (-).​
    • It can only contain Chinese characters, letters, digits, underscores (_), and hyphens (-).​
    • The length should be 2 to 64 characters.​
    ​
    Database version​
    The database version of the new instance after recovery remains consistent with the original instance; no selection is required.​
    Specification configuration​
    Instance type​
    Currently, only replica set instances support this feature; no selection is required.​
    ​
    Deployment method​
    You can select either Single availability zone deployment or Multiple availability zone deployment based on business needs, where:​
    • Set up single availability zone deployment​
    1. Select deployment method as Single availability zone deployment.​
    1. Select the desired availability zone from the right side of Availability zone, and choose whether to add read-only nodes based on your business needs.​
    • Set up multiple availability zone deployment​
    1. Select the deployment method as Multiple availability zone deployment.​
    1. From the Availability Zone dropdown list, set the desired availability zone for the primary node and each secondary node, and choose whether to add read-only nodes based on your business needs.​
    tip​
    • Only replica set instances and Shard in sharding cluster instances support adding read-only nodes.​
    • Each instance (or each Shard) can add up to 5 read-only nodes. For more details on read-only node feature introduction and limits, refer to MongoDB read-only nodes.​
    • Multiple availability zone deployment is only supported in regions with 3 or more availability zone resources.​
    ​
    Instance configuration​
    Set the following configuration for MongoDB replica set instance:​
    • Number of node(s): Each replica set instance is currently fixed at 3 nodes. No selection is required.​
    • Storage space: Select the storage space for instance. Unit: GiB, in increments of 10.​
    tip​
    • Node specifications are different, and the supported storage space ranges are also different. For the specific value range of storage space, refer to the console. If you need more storage, submit a ticket to contact technical support to increase the storage space limit.​
    • To ensure the new instance can run normally after recovery, the storage space capacity of the new instance needs to be greater than or equal to 1.2 times the used space of the original instance.​
    ​
    Specifications preview​
    View and confirm the performance details of the selected specifications, including node specifications, number of nodes, and storage capacity.​
    Network configuration​
    Virtual Private Cloud​
    Select the VPC where the instance is located from the drop-down list.​
    We recommend that you connect MongoDB instances to ECS instances in the same VPC. Otherwise, they cannot achieve optimal communication performance. For more details, refer to What is VPC.​
    tip​
    • If you have not created any VPCs yet, please click Create VPC on the right side of the drop-down list first. For specific procedures, refer to Creating VPC.​
    • After the instance is successfully created, you can modify the VPC and subnet to which the instance belongs. For detailed steps, refer to Modifying VPC or subnet.​
    • When you log on to the console with IAM user, you only see VPC information under the project that the IAM user belongs to. If you can't see the target VPC, confirm that IAM user is used and that IAM user has permissions on the target project resources.​
    ​
    Subnet​
    Select an available subnet in the current VPC from the drop-down list.​
    A subnet is an IP address block within a VPC. All cloud resources in the VPC must be deployed within a subnet. The subnet allocates private IP addresses to cloud resources.​
    tip​
    • If you have not created any subnet, click Create subnet on the right of the drop-down list to create a subnet. For specific procedures, refer to Creating subnet.​
    • Subnets possess availability zone properties. The drop-down list only shows subnets that belong to the same availability zone as the instance in the current VPC.​
    • You can specify a project when you create a VPC, but you cannot specify a project when you create a subnet, which is by default under the same project as the VPC to which it belongs. The project changes of the VPC and the subnet are independent, that is, modifying the project to which the VPC belongs will not modify the project of the subnet under the current VPC at the same time. For more details, refer to Managing projects.​
    • If the project to which a VPC belongs is modified, you also need to change the project of the subnets under the VPC accordingly to ensure the consistency of the projects to which they belong. Otherwise, when IAM user with non-global privileges creates a cloud resource (such as Document Database for MongoDB), it will not be able to select a subnet or anomalies will be reported. For specific procedures for modifying projects, refer to Editing project.​
    ​
    Default port​
    Set the port number of the private network connection address for the newly created instance. Default port: 3717. Value range: 1000 to 65535.​
    tip​
    After creating the instance successfully, you can modify the port number of connection address. For specific procedures, refer to Modifying port.​
    Advanced configuration​
    Project​
    When restoring a new instance, the new instance will default to using the project of the original instance.​
    You can also select a different project for the new instance from the dropdown list based on your business needs. The project information displayed in the drop-down list is related to the project you have selected in the upper left corner of the MongoDB console, where:​
    • If you select All resources, the drop-down list will display the default (Default project) project by default. You can also select other projects according to your business needs.​
    • If you select a specific project (for example, one you created yourself) instead of All resources, then the drop-down list will display the project by default. You can also select other projects according to your business needs.​
    tip​
    • After the instance is successfully created, you can also change the project to which the instance belongs. For example, move the instance from the current project to the target project, or move cloud resources that are not part of the project to the target project. For specific procedures, refer to Editing project.​
    • A project is a virtual concept that includes a set of resources, users, and roles. A project allows for a unified view and management of a set of resources, and controls the permissions of users and roles within the project for those resources. For more details, refer to Resource management.​
    ​
    Tag​
    Click Add tag and enter the tag key and tag value to add a tag to the instance.​
    A tag consists of a key-value object that identifies cloud resources. It can help you classify cloud resources with the same characteristics (such as use, owner, or environment) for easy filtering and aggregation, so that you can easily manage cloud resources. For more details, refer to Tag management.​
    ​
    Parameter configuration​
    Select a parameter template for the recovered new instance from the drop-down list.​
    tip​
    • Parameter templates must be applied to instances with the same database version. Therefore, the drop-down list only displays parameter templates that match the instance's database version. For example, if a MongoDB 6.0 instance is created, only parameter templates with a database version of MongoDB 6.0 will be displayed in the drop-down list. For more details on parameter templates, refer to Parameter template management.​
    • You can select a system parameter template, or click View parameter templates on the right of the drop-down list to go to the Parameter template page and create a custom template. For specific procedures, refer to Creating parameter template.​
    • If this configuration is left blank, no parameter template is selected, and all instance parameters use their default values.​
    • If you select a custom parameter template, but it does not include all parameters supported by the instance, the parameter values from the template are configured for the instance, and parameters not specified in that template use their default values.​
    Billing information​
    Billing method​
    You can choose between Pay-as-you-go or Subscription.​
    tip​
    If you select the billing method as Subscription, you need to confirm Purchase period, and you can also select Automatic renewal, and the system will automatically renew before the instance expires.​
    ​
  1. In the lower-right corner of the page, click Confirm order.​
  1. Complete the subsequent steps according to the billing method you selected.​
  • ​
Description​
  • It takes about several minutes to create an instance, and you can see the newly created instance in the instance list.​
  • You can go to Historical event to view the details of the event corresponding to restoring the new instance (the Event action is named RestoreToNewInstance), and view information such as the execution time and time consumption of the current event. For specific procedures, refer to Viewing historical events.​
Relevant APIs​
​
API​
Description​
Call the DescribeBackups API to query backup file list of target MongoDB instance.​
Call the RestoreToNewInstance API to restore instance data to new instance according to backup file or time point.​
​
​
Last updated: 2026.02.11 14:15:15