tencent cloud

Feedback

Database and Table Rollback

Last updated: 2024-05-07 09:58:01

    Overview

    When the business only requires restoration operations on multiple databases and tables, Database and Table Rollback can be performed through the console, restoring the data to either the existing instance or a new one. Compared to a rollback of entire instance, a database or table rollback involves less data and results in a quicker process.

    Version Description

    Version
    Rollback Method
    3.2, 3.6
    Rollback of entire instance (logical backup)
    Collection rollback (logical backup)
    4.0, 4.2, 4.4
    Rollback of entire instance (logical backup, physical backup)
    Collection rollback (logical backup, physical backup)
    5.0
    Rollback of entire instance (logical backup, physical backup)
    Collection rollback (logical backup)
    Note:
    Version 5.0 instances temporarily do not support a database or table rollback to a new instance.
    Flashback by Key (Logical Backup)

    Use Limits

    You can select up to 2,000 collections per instance to roll back.
    You can roll back data to any time point in the last 7 days.
    Note:
    Pay close attention to the Oplog Time Lag monitoring metric found within the System Monitoring section of the instance management page. In scenarios where your business experiences frequent write, update, and delete operations, the smaller this metric becomes, the higher the likelihood that the oplog will be at risk of being overwritten.
    If there are transaction operations on the client during the rollback process, you need to actively submit the transaction or set a timeout period to prevent the transaction from occupying lock resources for a long time and causing the rollback task to be abnormal.

    Prerequisites

    You have created a TencentDB for MongoDB instance. For more information, see Creating TencentDB for MongoDB Instance.
    The status of the TencentDB for MongoDB instance is Running .
    You have backed up the data. For more information, see Data Backup.

    Directions

    2. In the MongoDB drop-down list on the left sidebar, select Replica Set Instance or Sharded Cluster Instance. The directions for replica set instances and sharded cluster instances are similar.
    3. Above the Instance List on the right, select the region.
    4. In the instance list, find the target instance.
    5. On the Instance Details page, select the Backup and Rollback tab.
    6. Navigate to the Backup and Rollback tab and access the Backup Task List page.
    7. In the Backup Task List, find the backup file to be restored.
    8. In the Operation column, click Database and Table Rollback .
    
    9. In the Batch Rollback Database and Table Data configuration wizard, on the Select Archive Instance tab, after the Rollback Target Instance , select either Rollback to Current Instance or Rollback to New Instance . Within Select Rollback Type , select Database and Table Rollback .
    Note:
    Rollback to the Current Instance eliminates the need to purchase a new instance by restoring databases and tables to the current instance. It supports the selection of multiple instances for batch rollback, allowing for database and table rollback or key-based flashback according to the actual scenario. In the instance list below, check one or more instances to be rolled back (you can search by instance ID, instance name, or IP address in the search box). For detailed operations, see Database and Table Rollback to the Current Instance.
    Rollback to a New Instance requires the purchase of a new instance and does not affect the source instance. It does not support selecting multiple instances for batch rollback. Depending on the actual scenario, you can choose to perform a database and table rollback, a key-based flashback, or clone an instance. In the instance list below, check only one instance to be rolled back (you can search by instance ID, instance name, or IP address in the search box). For specific operations, see Rolling Back Databases and Tables to a New Instance.
    

    Rolling Back Databases and Tables to Current Instance

    1. Click Next: Select Databases and Tables to Roll Back . On the Select Rollback Database and Table tab, select the databases and tables to be rolled back. Confirm the database and table information in the right-side box zone. As shown below.
    Note:
    In the right-side zone, you can confirm and modify the selected databases and tables.
    click Clear Selection to clear the selected databases and tables if the wrong selection is made.
    click
    
    to delete the selected databases and tables one by one.
    
    2. Click Next: Select Rollback Time . On the Setting Rollback Time tab, select the specific time point for the rollback from the time frame following Setting Rollback Time . Confirm the instance information and the database and tablesinformation to be pre-rolled back.
    Note:
    Rollback time only supports selecting data from any time point within the last 7 days before the current time.
    Rollback to the current instance does not rollback the original databases and tables directly but creates a new backup file. For instance, if the source database or table is test, a new database or table test_bak will be created. As shown below, Rollback Database and Table Names are the names of the newly created databases and tables.
    After the rollback task is completed, you can batch modify database and table names as needed.
    In versions of TencentDB for MongoDB below 5.0, sharded clusters rolling back to the current instance cannot modify database and table names. Data must be manually replaced back into the original databases and tables.
    
    3. Click Start Rollback . Return to Rollback Task tab of the Batch Rollback Database and Table Data . You can see ongoing rollback tasks. Click the Operation column's Task Details to view the detailed information of the task. Wait until the task is completed. Then you can connect to the instance to confirm the correctness of the rolled-back data.
    
    4. (Optional) Select the Batch Rename Databases and Tabled tab under Batch Rollback Database and Table Data . Find the completed rollback task. In its Operation column, click Batch Modify Database and Table Names to view information about the databases and tables to be modified on the right zone. The information includes original database and table names, new original database and table names, rollback database and table names, and new rollback database and table names.
    Click
    
    to download information of the databases and tables to be modified. Then you may view locally.
    Confirm the changes. Click Batch Rename Databases and Tables at the bottom left to complete the modifications.
    Note:
    Batch Rename Databases and Tables can only modify all databases and tables under a single instance of a single rollback task. If a user initiates a batch rollback task and rolls back databases and tables of multiple instances, the database and table names need to be modified one by one. For specific operations, see Batch Rollback.
    Batch Rename Databases and Tables includes changing the original database and table names and rollback database and table names.
    For original databases and tables, the mark _ori is added to their original names.
    For rollback databases and tables, change the rollback database and table names to the original ones.
    

    Rolling Back Databases and Tables to a New Instance

    1. Click Next: Select databases and tables to roll back . On the Select Rollback Database and Table tab, choose the databases and tables of the source instance to be rolled back. In the search box, you can search for the databases and tables to be rolled back based on the database and table names. And in the right box zone, you can view the selected database and table information. As shown below. In the right box zone, you can manage the selected databases and tables.
    Click Clear Selection to clear the selected databases and tables if the wrong selection is made.
    Click
    
    to delete the selected database and table one by one.
    
    2. Click Next: Select Rollback Time . In the Setting Rollback Time tab, select the specific time point for the rollback from the time frame provided under Setting Rollback Time . Confirm the instance information and the database and table information to be pre-rolled back.
    3. Click Proceed to Purchase and Configure the Replica Instance . Enter the TencentDB for MongoDB clone instance page and select the billing mode, configuration specifications, etc., for the new instance. For more information, see Create MongoDB Instance.
    4. Confirm the cost, and click Purchase Now .
    5. Return to the instance list page. Once the instance has been created, the source instance's databases and tables have been synchronized to the newly purchased clone instance. Then you can connect to the new instance to confirm the correctness of the rollback data.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support