Help Center/ GeminiDB/ GeminiDB Redis API/ Data Migration/ Restoring RDB Files to GeminiDB Redis API (Recommended)
Updated on 2024-08-06 GMT+08:00

Restoring RDB Files to GeminiDB Redis API (Recommended)

Scenarios

Redis data of other vendors or self-hosted Redis can be migrated to GeminiDB Redis API.

You need to download the source Redis data, then upload the data to an OBS bucket in the same region as the GeminiDB Redis instance, and create a data import task on the GeminiDB console to import the data to the GeminiDB Redis instance.

Precautions

  • Importing data will overwrite data of the current database.
  • Importing backups generated by a later-version Redis instance to an earlier one may fail.
  • Before importing backups, ensure that resource-intensive commands (such as FLUSHALL, KEYS, and HGETALL) have been disabled on the target Redis instance.
  • If a backup contains multi-DB data, its database count cannot exceed what is supported by the target Redis instance.
  • Only .rdb files can be imported.

Creating an OBS Bucket and Uploading Backups

If the backup to be uploaded is larger than 5 GB, follow the instructions provided by OBS.

Perform the following steps if the backup is smaller than 5 GB:

  1. Create an OBS bucket.

    When creating an OBS bucket, configure the following parameters as requested. For details, see Creating a Bucket in OBS User Guide.

    1. Region:

      The OBS bucket must be in the same region as the destination Redis instance.

    2. Storage Class: Available options are Standard, Infrequent Access, and Archive.

      Do not select Archive. Otherwise, the backup may fail to be imported.

    3. Click Create Now.

  2. In the bucket list, click the bucket created in 1.
  3. In the navigation pane, choose Objects.
  4. On the Objects tab page, click Upload Object.
  5. Specify Storage Class.

    Do not select Archive. Otherwise, the backup may fail to be imported.

  6. Upload the objects.

    Drag files or folders to the Upload Object area or click add file.

    A maximum of 100 files can be uploaded at a time. The total size cannot exceed 5 GB.

    Figure 1 Uploading objects in batches

  7. (Optional) Select KMS encryption to encrypt the uploaded files.
  8. Click Upload.

Importing Backups

  1. Log in to the management console.
  2. In the service list, choose Databases > GeminiDB Redis API.
  3. On the Instances page, locate the target instance and choose More > Import Data in the Operation column.

    Figure 2 Importing data

  4. On the Data Import page, specify OBS Bucket to which a backup have been uploaded.
  5. Click Add Backup and select the backups to be imported.

    Figure 3 Adding backups

    • A maximum of 128 backups can be added at a time.
    • To delete a backup, locate the target backup and click Delete in the Operation column.
    • To delete all backups, select Clear for Backup.

  6. Click Create Now.
  7. Confirm the data import and click OK.

    Importing data will overwrite data of the current database.

    Figure 4 Confirming to import data