All Products
Search
Document Center

Tablestore:Restore data to Tablestore

Last Updated:Dec 11, 2023

If an exception or unintentional error occurs in a Tablestore instance, you can restore the backup data to the source Tablestore instance or another Tablestore instance that resides in the same region as the source Tablestore instance. This topic describes how to use Cloud Backup to create a Tablestore restore job.

Prerequisites

A Tablestore backup plan is created, and backup data is available. For more information, see Back up data in Tablestore.

Usage notes

  • When you restore a table that contains auto-increment columns, you can only rebuild auto-increment columns and restore only the putRow operation. In incremental backup, the updateRow and deleteRow operations performed on the table are ignored. For example, if the putRow operation is performed on a row multiple times in a source table, after the table is restored, the row becomes multiple rows. This is because a new row of data is created each time the value of an auto-increment column is regenerated.

  • You can run a restore job to restore the data and search indexes of only one table.

  • A restore job overwrites the rows with the same primary key in the destination table. Other rows are not affected.

  • If you specify a destination table name that does not exist, the restore job creates a table based on the table that was backed up. If you restore a table to an existing table, make sure that the schema of the destination table is the same as that of the source table. In addition, you must set a valid max version offset and data lifecycle for the destination table to prevent write failures during restoration or data expiration shortly after restoration.

Procedure

  1. Go to the Create Restore Job panel.

    1. Log on to the Tablestore console.

    2. In the left-side navigation pane, click Data Backup.

    3. On the Data Backup page, select the region in which the resources that you want to restore reside.

      The system automatically obtains the instance list in the selected region.

    4. Find the instance that you want to restore and click Restore in the Actions column.

      Note

      To restore data to another instance, find the instance and choose More > Restore to This Instance in the Actions column.

  2. Configure the restoration settings.

    1. Configure the parameters for restoring data.

      Parameter

      Description

      Recoverable Tables

      The name of the table that you want to restore. Select a table from the Recoverable Tables drop-down list. The drop-down list displays only the tables that you selected when you created the backup plan.

      Recoverable Time Point

      The time range in which available backup sets are created. Select a time range from the Recoverable Time Point drop-down list. The drop-down list displays time ranges based on the scheduled execution time that you specified for the backup plan.

      Choose Recovery Point

      The point in time to which you want to restore data. You can drag the timeline slider to specify a point in time.

    2. Modify the parameters in the Restore Options section based on your business requirements. By default, the system regenerates auto-increment columns and restores search indexes after the restore job is run.

      Parameter

      Description

      Regenerate Auto-increment Columns

      Specifies whether to regenerate auto-increment columns during restoration if the source table has auto-increment columns. By default, Regenerate Auto-increment Columns is turned on and cannot be turned off.

      Important

      If an auto-increment primary key column exists in the source table, this configuration takes effect. Otherwise, this configuration does not take effect.

      Restore Search Indexes

      Specifies whether to restore the search indexes of the source table. By default, Restore Search Indexes is turned on. Configure this parameter based on your business requirements.

      • If you want to restore the search indexes of the source table, turn on Restore Search Indexes and specify a suffix for the search indexes based on your business requirements.

        If you do not specify a suffix for the search indexes, the system automatically adds a suffix to the search indexes.

        Important

        If a search index exists in the source table, this configuration takes effect. Otherwise, this configuration does not take effect.

      • If you do not want to restore the search indexes of the source table, turn off Restore Search Indexes.

  3. Configure the destination Tablestore instance to which you want to restore data.

    1. Select a destination Tablestore instance from the Restore to Database drop-down list.Tablestore

      The drop-down list displays all the Tablestore instances that belong to your Alibaba Cloud account in the selected region. You can restore the data of the source Tablestore instance to another Tablestore instance in the same region within the same Alibaba Cloud account.

    2. The system automatically generates a new name for the table to which data is restored. Modify the table name based on your business requirements.

      Important

      The name of the table to which data is restored cannot be the same as the name of an existing data table or index table.

  4. Click OK.

    After a restore job is created, you can view the job progress in the Status column on the Restore Jobs tab. If the Status column of the restore job changes to Completed and the progress is 100%, the data is restored.

    To cancel a restore job that is in progress, click Cancel in the Actions column and click OK.

    image.png

Verify the restoration results

View the configurations and data of the restored table in the Tablestore console.

  1. Log on to the Tablestore console.

  2. In the upper part of the Overview page, select a region.

  3. Click the name of the Tablestore instance to which data is restored.

  4. On the Instance Details tab, click the name of the restored table on the Tables tab.

  5. Check the information about the restored table.

    • On the Basic Information tab, view the basic information, primary key columns, and predefined columns of the table.

      Note

      If the configurations of table properties or predefined columns do not meet your business requirements, you can manually modify the configurations.

    • On the Query Data tab, verify that the required data is restored to the table.