|
| 1 | +# Create a Migrator Configuration File |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +A configuration file defines all the parameters required for the migration activity. You pass this configuration file as a single parameter to the **runMigrator** command from the Cloud Shell. |
| 6 | + |
| 7 | +This lab walks you through the steps to identify important source and sink parameters. You will create an Oracle NoSQL Migrator configuration file in the Cloud Shell to migrate data from an Oracle NoSQL Database Cloud Service table to an OCI Object Storage bucket. |
| 8 | + |
| 9 | +Estimated Lab Time: 10 minutes |
| 10 | + |
| 11 | +### Objectives |
| 12 | + |
| 13 | +In this lab you will: |
| 14 | +* Identify the source and sink for migrating data. |
| 15 | +* Create a migrator configuration file. |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | + |
| 19 | +* An Oracle Free Tier, Always Free, Paid or LiveLabs Cloud Account. |
| 20 | +* Oracle NoSQL Database Cloud Service table in the subscribed region as the source for data migration. |
| 21 | +* OCI Object Storage bucket in the subscribed region as the sink to store the migrated data. |
| 22 | +* Privileges to write objects in the Object Storage Bucket. For more details on setting the policies, see **[Let users write objects to Object Storage buckets](https://docs.oracle.com/en-us/iaas/Content/Identity/policiescommon/commonpolicies.htm#write-objects-to-buckets)**. |
| 23 | + |
| 24 | +## Task 1: Identify the Source Parameters |
| 25 | + |
| 26 | +To configure the Migrator utility to copy data from an Oracle NoSQL Database Cloud Service table, you need the following source parameters: **table, compartment, endpoint**. |
| 27 | + |
| 28 | +1. From your Oracle Cloud console's navigation menu, select **Databases** and then select **Tables** under **Oracle NoSQL Database**. See **Get Started** lab for detailed steps to access the Oracle Cloud Console. |
| 29 | + |
| 30 | +2. Select your compartment from the drop-down menu to view the tables. |
| 31 | + |
| 32 | +3. Identify the Oracle NoSQL Database Cloud Service table whose data you want to migrate and note down the table name. |
| 33 | + |
| 34 | + Here, you will use the **NDCSupload** table from the **Training_NoSQL** compartment in the **Ashburn** region with following sample data: |
| 35 | + |
| 36 | + ``` |
| 37 | + <copy> |
| 38 | + {"id":1,"name":"Tracy","email":"Tracy@mymail.com","age":20,"income":1000} |
| 39 | + {"id":2,"name":"Benita","email":"Benita@mymail.com","age":22,"income":22000} |
| 40 | + {"id":3,"name":"John","email":"John@mymail.com","age":24,"income":24000} |
| 41 | + {"id":4,"name":"Adam","email":"Adam@mymail.com","age":26,"income":26000} |
| 42 | + ... |
| 43 | + </copy> |
| 44 | + ``` |
| 45 | + |
| 46 | +4. Select the **NDCSupload** table. From the *Table details* page, hover over the Compartment OCID field and select the copy option. This copies the compartment OCID of your source table to the clipboard. Save the compartment OCID value. |
| 47 | + |
| 48 | + Note down the endpoint for your source table. You can locate your subscribed region at the upper right corner of the console. For the details on the end points for your subscribed region, see **[Data Regions and Associated Service URLs](https://docs.oracle.com/en/cloud/paas/nosql-cloud/fnsxl/index.html#FNSXL-GUID-D89BB422-A394-404E-8759-1A620C7D8125)**. |
| 49 | + |
| 50 | +  |
| 51 | + |
| 52 | + At the end of this step, you will have values for the following parameters: |
| 53 | + |
| 54 | + ``` |
| 55 | + <copy> |
| 56 | + endpoint: "<endpoint for your subscribed region>" |
| 57 | + compartment: "<Compartment OCID>" |
| 58 | + table: "NDCSupload" |
| 59 | + </copy> |
| 60 | + ``` |
| 61 | + |
| 62 | + For example, |
| 63 | + |
| 64 | + ``` |
| 65 | + <copy> |
| 66 | + endpoint: "us-ashburn-1" |
| 67 | + compartment: "ocid1.compartment.oc1..aaaaaaaahcrgrgptoaq4cgpoymd32ti2ql4sdpu5puroausdf4og55z4tnya" |
| 68 | + table: "NDCSupload" |
| 69 | + </copy> |
| 70 | + ``` |
| 71 | + |
| 72 | + The **endpoint** and **compartment** parameter values differ based on your tenancy. |
| 73 | + |
| 74 | +## Task 2: Identify the Sink Parameters |
| 75 | + |
| 76 | +To configure the Migrator utility to copy data into the Object Storage bucket, you need the following sink parameters: **endpoint, prefix, bucket, namespace**. |
| 77 | + |
| 78 | +1. From the Oracle Cloud console navigation menu, select **Storage** and then select **Buckets**. |
| 79 | + |
| 80 | +2. Select your compartment and then select the bucket. |
| 81 | + |
| 82 | + Here, you will use the **Migrate\_oci** bucket from the **Training_NoSQL** compartment in the **Ashburn** region. |
| 83 | + |
| 84 | + From the bucket details page, copy the **Namespace** name to use in sink configuration parameters. |
| 85 | + |
| 86 | +  |
| 87 | + |
| 88 | +3. Identify the endpoint of the OCI Object Storage bucket. You can locate your subscribed region at the upper right corner of the console. For the details on the OCI Object Storage service endpoints for your subscribed region, see **[Object Storage Endpoints](https://docs.oracle.com/en-us/iaas/api/#/en/objectstorage/20160918/)**. |
| 89 | +4. Decide a prefix, which serves as the directory to store the migrated data within the OCI Object Storage bucket. Oracle NoSQL Migrator copies data to the supplied directory in the OCI Object Storage bucket. |
| 90 | + |
| 91 | + Here, you will use **Delegation** as the prefix. |
| 92 | + |
| 93 | + At the end of this step, you will have values for the following parameters: |
| 94 | + |
| 95 | + ``` |
| 96 | + <copy> |
| 97 | + endpoint: "<endpoint for your subscribed region>" |
| 98 | + bucket: "Migrate_oci" |
| 99 | + prefix: "Delegation" |
| 100 | + namespace: "<namespace name>" |
| 101 | + </copy> |
| 102 | + ``` |
| 103 | + |
| 104 | + For example, |
| 105 | + |
| 106 | + ``` |
| 107 | + <copy> |
| 108 | + endpoint: "us-ashburn-1" |
| 109 | + bucket: "Migrate_oci" |
| 110 | + prefix: "Delegation" |
| 111 | + namespace: "oradbclouducm" |
| 112 | + </copy> |
| 113 | + ``` |
| 114 | + |
| 115 | + The **endpoint** and **namespace** parameter values differ based on your tenancy. |
| 116 | + |
| 117 | +## Task 3: Create a Configuration File |
| 118 | + |
| 119 | +1. Launch the Cloud Shell from the **Developer tools** menu on your Oracle Cloud console. The web browser opens your home directory. |
| 120 | +2. Navigate to the directory where you extracted the NoSQL Database Migrator utility. See **Lab - Download Migrator Utility and Upload to Cloud Shell**. |
| 121 | + |
| 122 | + ``` |
| 123 | + <copy>cd V1048015-01/nosql-migrator-1.7.0</copy> |
| 124 | + ``` |
| 125 | +
|
| 126 | +3. Create the configuration file template in a notepad as follows. Update the source and sink parameters with the values that you noted in Task 1 and Task 2 of this lab. |
| 127 | +
|
| 128 | + *Note: The endpoints, compartment, and namespace values will differ based on your tenancy.* |
| 129 | +
|
| 130 | + ``` |
| 131 | + <copy> |
| 132 | + { |
| 133 | + "source" : { |
| 134 | + "type" : "nosqldb_cloud", |
| 135 | + "endpoint" : "us-ashburn-1", |
| 136 | + "table" : "NDCSupload", |
| 137 | + "compartment" : "ocid1.compartment.oc1.. aaaaaaaahcrgrgptoaq4cgpoymd32ti2ql4sdpu5puroausdf4og55z4tnya", |
| 138 | + "useDelegationToken" : true, |
| 139 | + "readUnitsPercent" : 90, |
| 140 | + "includeTTL" : true, |
| 141 | + "requestTimeoutMs" : 5000 |
| 142 | + }, |
| 143 | + "sink" : { |
| 144 | + "type" : "object_storage_oci", |
| 145 | + "format" : "json", |
| 146 | + "endpoint" : "us-ashburn-1", |
| 147 | + "namespace" : "oradbclouducm", |
| 148 | + "bucket" : "Migrate_oci", |
| 149 | + "prefix" : "Delegation", |
| 150 | + "chunkSize" : 32, |
| 151 | + "compression" : "", |
| 152 | + "useDelegationToken" : true |
| 153 | + }, |
| 154 | + "abortOnError" : true, |
| 155 | + "migratorVersion" : "1.7.0" |
| 156 | + } |
| 157 | + </copy> |
| 158 | + ``` |
| 159 | + |
| 160 | + To run the Migrator utility from the Cloud Shell, you must use the delegation token authentication. Therefore, set the **useDelegationToken** parameter to true. For a list of all the supported parameters, see **[Oracle NoSQL Database Cloud Service](https://docs.oracle.com/en/cloud/paas/nosql-cloud/onscl/#GUID-5A70801B-F281-4FA2-91A9-77CCCC3C3098)** source and **[OCI Object Storage bucket](https://docs.oracle.com/en/cloud/paas/nosql-cloud/onscl/#GUID-B79ED267-0F42-40CE-B672-9F7AB65BDA1D)** sink. |
| 161 | +
|
| 162 | + *Note: The Oracle NoSQL Migrator utility also provides an option to create the configuration file interactively when you run the utility from the Cloud Shell's CLI.* |
| 163 | +
|
| 164 | +4. Use the vi editor to create the **migrator-config.json** configuration file. |
| 165 | +
|
| 166 | + Copy the configuration file template from the notepad to the configuration file and save it. |
| 167 | +
|
| 168 | + ``` |
| 169 | + <copy>vi migrator-config.json</copy> |
| 170 | + ``` |
| 171 | +
|
| 172 | +You may proceed to the next lab. |
| 173 | +
|
| 174 | +## Learn More |
| 175 | +
|
| 176 | +* **[Using Console to Create Tables in Oracle NoSQL Database Cloud Service](https://docs.oracle.com/en/cloud/paas/nosql-cloud/wqqvo/index.html#articletitle)** |
| 177 | +* **[Terminology used with Oracle NoSQL Database Migrator](https://docs.oracle.com/en/cloud/paas/nosql-cloud/cjphq/index.html#GUID-3F02818F-0589-4366-9D1E-8230FADFDFE8)** |
| 178 | +* **[Source Configuration Templates](https://docs.oracle.com/en/cloud/paas/nosql-cloud/onscl/index.html#ONSCL-GUID-FF56A474-C6EC-40DA-8AAA-9EBA6B616630)** |
| 179 | +* **[Sink Configuration Templates](https://docs.oracle.com/en/cloud/paas/nosql-cloud/onscl/index.html#ONSCL-GUID-832FE48D-2A90-4DCA-95A6-40687CA7F39B)** |
| 180 | +
|
| 181 | +## Acknowledgements |
| 182 | +* **Author** - Ramya Umesh, Principal UA Developer, DB OnPrem Tech Svcs & User Assistance |
| 183 | +* **Last Updated By/Date** - Ramya Umesh, Principal UA Developer, DB OnPrem Tech Svcs & User Assistance, August 2025 |
0 commit comments