Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ Document Database Service/ User Guide/ Data Restorations/ Restoring Data to a Point in Time/ Restoring a Replica Set Database and Table to a Point in Time

Restoring a Replica Set Database and Table to a Point in Time

Updated on 2024-11-29 GMT+08:00

To ensure data integrity and reduce impact on the original instance performance, the system restores the full and incremental data at the selected time point to a temporary instance, automatically exports the databases and tables to be restored, and then restores the databases and tables to the original instance. The time required depends on the amount of data to be backed up and restored on the instance. Please wait.

Restoring databases and tables will not overwrite data in the instance. You can select databases and tables to be restored.

Precautions

  • Currently, only replica set instances of version 4.0 or later support the point-in-time recovery at the database and table level.
  • Before performing the restoration, you need enable the automated backup policy.
  • After a successful restoration, a new table named Original table name_bak_Timestamp is generated in the instance by default. If the table contains an index, the namespace of the index is changed to Original database name.Original table name_bak_Timestamp. You can rename the table later as required.
  • New databases and tables will be generated in the original DB instance. Ensure that sufficient storage space is available.
  • The length of <Database name>.<Table name> cannot exceed 120 characters. The length of <Database name>.<Table name>.<Index name> cannot exceed 128 characters, or the restoration may fail.
  • Ensure that the name of the restored table is different from that of the existing table, or the restoration may fail.
  • If you perform a table-level restoration and the table does not exist at the required point in time, an empty table is automatically created. If you perform a database-level restoration, the missing table is not created.
  • If the incremental oplog traffic is greater than 250 GB/h, the incremental backup speed may not keep up with the oplog generation speed. As a result, some restoration time points may be unavailable.
  • Only whitelisted users can use this function. You need to submit a service ticket to apply for this function. In the upper right corner of the management console, choose Service Tickets > Create Service Ticket to submit a service ticket.

Restrictions

  • Database- and table-level restoration is related to CPU and memory specifications. For details about the maximum size of a single data record that can be restored to a specified time point, see Table 1.
  • If a database- and table-level restoration fails, you can upgrade the specifications or batch restore the databases and tables to a specified time point.
Table 1 Specifications

CPU Type

Specifications

vCPUs

Memory (GB)

Maximum Size of a Single Data Record That Can Be Restored in a Collection

x86

General-purpose

2

4

400 KB

2

8

800 KB

4

8

1 MB

4

16

1.3 MB

8

16

1.3 MB

8

32

2 MB

Enhanced II

1

8

400 KB

2

8

800 KB

2

16

800 KB

4

16

1.3 MB

4

32

1.3 MB

8

32

2 MB

8

64

3 MB

16

64

4 MB

16

128

7 MB

32

128

7 MB

32

256

10 MB

64

256

10 MB

64

512

16 MB

Kunpeng

-

2

4

400 KB

-

2

8

800 KB

-

4

8

1 MB

-

4

16

1.3 MB

-

8

16

1.3 MB

-

8

32

2 MB

-

16

32

2 MB

-

16

64

4 MB

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the replica set instance.
  5. In the navigation pane on the left, choose Backups & Restorations.
  6. On the Backups & Restorations page, click Restore Database and Table.
  7. In the displayed dialog box, configure parameters as required. The data in the new database and table is the same as that in the database and table at the selected time point.

    Table 2 Database information

    Parameter

    Description

    Date

    Date when the automated backup of the DB instance is generated.

    Time Range

    Time range during which the automated backup can be restored.

    Time Point

    The specific point in time when the automated full backup is generated.

    Base Time Range

    Time range during which the database and table can be restored based on the automated full backup.

    Database and Table

    Databases and tables that have been automatically backed up within the base time range are displayed on the left. Select the databases and tables on the left to sync information to the area on the right.

    Time Point

    The point in time within the base time range.

    Custom Database and Table

    You can add custom databases and tables as required.

    • The system databases cannot be restored. Therefore, the database name cannot be admin, local, or config.
    • The database name cannot contain spaces and the following special characters: ".$\/*?~#:|
    • A table name cannot use "system" as the prefix.
    • The length of <Database name>.<Table name> cannot exceed 120 characters. The length of <Database name>.<Table name>.<Index name> cannot exceed 128 characters, or the restoration may fail.
    • Ensure that the name of the restored table is different from that of the existing table. Otherwise, the restoration may fail.
    • After a successful restoration, a new table named Original table name_bak_Timestamp is generated in the instance by default. If the table contains an index, the namespace of the index is changed to Original database name.Original table name_bak_Timestamp. You can rename the table later as required.

    To distinguish the point in time of the custom databases and tables from those synchronized on the right, set the point in time to a different value. The system restores data to the custom databases and tables based on the time configured here.

    Type

    You can restore data to a database or table.

    If you perform a table-level restoration and the table does not exist at the required point in time, an empty table is automatically created. If you perform a database-level restore, data will be restored to the database separately, and the table will not be created.

    Figure 1 Selecting database and table

  8. Click Next: Confirm.
  9. Click Submit to start the restoration.

    Figure 2 Confirming the information

  10. On the Instances page, the DB instance status is Restoring. During the restoration process, services are not interrupted.
  11. After the restoration is successful, manage data in the database and table as required.

    If you need to use the original database and table names, you can use a rename operation to back up the original database and table and switch your service to the restored database and table. Then, delete the original database and table after ensuring that your services are normal.

    Example:

    db.adminCommand({renameCollection: "db1.test1", to: "db2.test2"})

    The above command is used to move the test1 table from the db1 database to the db2 database and rename the table to test2.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback