Help Center/ Object Storage Migration Service/ Best Practices/ Special Migration Scenarios/ Adding a Name Prefix or Path Prefix to Migrated Objects
Updated on 2024-04-19 GMT+08:00

Adding a Name Prefix or Path Prefix to Migrated Objects

Overview

The Specify Prefix parameter enables you to:

  • Add a name prefix to objects migrated to the destination bucket.

    For example, if you set Specify Prefix to Yes and specify the prefix Test-Prefix when you create a migration task or task group, source objects oms_a.txt and oms_b.txt will be renamed Test-Prefixoms_a.txt and Test-Prefixoms_b.txt after they are migrated to the destination bucket.

  • Add a path prefix to objects migrated to the destination bucket.

    For example, if you set Specify Prefix to Yes and specify the path prefix Test-Prefix/ when you create a migration task or task group, OMS will create a Test-Prefix/ directory in the root directory of the destination bucket, and migrate source objects, such as oms_a.txt and oms_b.txt to it. The paths to oms_a.txt and oms_b.txt will be Destination bucket name/Test-Prefix/oms_a.txt and Destination bucket name/Test-Prefix/oms_b.txt.

Scenarios

This section uses the File/Folder migration method as an example to describe how to configure Specify Prefix during the creation of a migration task or task group.

You can use Specify Prefix to:

Add a Name Prefix to Migrated Files

  1. Log in to the Huawei Cloud console.
  2. Click in the upper left corner and select the region where the destination bucket is located from the drop-down list.

    Figure 1 Selecting the region where the destination bucket is located

  3. Click Service List in the upper left corner, and choose Migration > Object Storage Migration Service.

    You can also enter OMS in the search box to quickly find OMS.
    Figure 2 Choosing OMS

  4. On the Migration Tasks page, click Create Migration Task in the upper right corner.

    Figure 3 Creating a migration task

  5. Read the service disclaimer, select I have read and agree to the service disclaimer, and click OK. The Create Migration Task page is displayed.

    Figure 4 Select Source/Destination

  6. Set parameters in the Select Source area. For details, see Table 1.

    Table 1 Parameters for configuring a source bucket

    Parameter

    Configuration

    Data Source

    Select Huawei Cloud.

    Access Key ID

    Enter the AK for the Huawei Cloud account to which the source bucket belongs.

    Secret Access Key

    Enter the SK for the Huawei Cloud account to which the source bucket belongs.

    Specify Source Bucket

    If you disable Specify Source Bucket (which is disabled by default), you need to:

    1. Click List Buckets next to Bucket. All buckets in the account will be listed.
    2. Select the bucket you want to migrate from the drop-down list.
    NOTE:

    If the source account does not have the permissions required to list buckets, you need to enable Specify Source Bucket.

    If you enable Specify Source Bucket, you need to:

    1. Select the region where the source bucket is located from the Region drop-down list.
    2. In the Bucket text box, enter the name of the bucket or the directory to be migrated. The directory must have the bucket name included.
    3. Click Connect.

  7. Set parameters in the Select Destination area and click Next. For details, see Table 2.

    Table 2 Parameters for configuring a destination bucket

    Parameter

    Configuration

    Access Key ID

    Enter the AK for the Huawei Cloud account to which the destination bucket belongs.

    Secret Access Key

    Enter the SK for the Huawei Cloud account to which the destination bucket belongs.

    Click List Buckets.

    Bucket

    Select a destination OBS bucket for storing the migrated data.

  8. On the displayed Set Task Parameters page, set parameters.

    Figure 5 Setting task parameters

  9. In the Source Configuration area, set Select Migration Method to File/Folder.

    Figure 6 Selecting a migration method

  10. Click Select on the left of the Bucket box. In the Select File/Folder dialog box, as shown in Figure 7, select one or more files to be migrated and click OK.

    Figure 7 Selecting files

  11. In the Destination Configuration area, select Yes for Specify Prefix and enter a prefix, for example, Test-Prefix.

    Figure 8 Specifying a prefix

  12. Click Next to access the confirmation page.

    Figure 9 Confirmation

  13. Confirm the configuration and click Migrate Now.
  14. After the migration is complete, view the migrated files in the destination bucket. You will see the prefix Test-Prefix has been added to the names of these files.

    Figure 10 Verification

Add a Path Prefix to Migrated Files

  1. In the Source Configuration area, set Select Migration Method to File/Folder.

    Figure 11 Selecting a migration method

  2. Click Select on the left of the Bucket box. In the Select File/Folder dialog box, as shown in Figure 12, select one or more files to be migrated and click OK.

    Figure 12 Selecting files

  3. In the Destination Configuration area, select Yes for Specify Prefix and enter a path prefix, for example, Test-Prefix/.

    Figure 13 Specifying a path prefix

  4. Click Next to access the confirmation page.

    Figure 14 Confirmation

  5. Confirm the configuration and click Migrate Now.
  6. After the migration is complete, view the migrated files in the destination bucket. You will see that these files are all stored in the Test-Prefix/ directory of the destination bucket.

    Figure 15 Verification

Add a Name Prefix to Migrated Folders

  1. In the Source Configuration area, set Select Migration Method to File/Folder.

    Figure 16 Selecting a migration method

  2. Click Select on the left of the Bucket box. In the Select File/Folder dialog box, as shown in Figure 17, select one or more folders to be migrated and click OK.

    Figure 17 Selecting folders

  3. In the Destination Configuration area, select Yes for Specify Prefix and enter a prefix, for example, Test-Prefix.

    Figure 18 Specifying a prefix

  4. Click Next to access the confirmation page.

    Figure 19 Confirmation

  5. Confirm the configuration and click Migrate Now.
  6. After the migration is complete, view the migrated folders in the destination bucket. You will see the prefix Test-Prefix has been added to the names of these folders.

    Figure 20 Verification

Add a Path Prefix to Migrated Folders

  1. In the Source Configuration area, set Select Migration Method to File/Folder.

    Figure 21 Selecting a migration method

  2. Click Select on the left of the Bucket box. In the Select File/Folder dialog box, as shown in Figure 22, select one or more folders to be migrated and click OK.

    Figure 22 Selecting folders

  3. In the Destination Configuration area, select Yes for Specify Prefix and enter a path prefix, for example, Test-Prefix/.

    Figure 23 Specifying a path prefix

  4. Click Next to enter the confirmation page.

    Figure 24 Confirmation

  5. Confirm the configuration and click Migrate Now.
  6. After the migration is complete, view the migrated folders in the destination bucket. You will see that these folders are all moved to the Test-Prefix/ directory of the destination bucket.

    Figure 25 Verification

Add a Path Prefix to the Whole Bucket

  1. In the Source Configuration area, set Select Migration Method to File/Folder.

    Figure 26 Selecting a migration method

  2. In the Destination Configuration area, select Yes for Specify Prefix and enter a path prefix, for example, Test-Prefix/.

    Figure 27 Specifying a path prefix

  3. Click Next to access the confirmation page.

    Figure 28 Confirmation

  4. Confirm the configuration and click Migrate Now.
  5. After the migration is complete, view the directory where the entire bucket is stored. You will see all objects in the source bucket are moved to the Test-Prefix/ directory of the destination bucket.

    Figure 29 Verification