Skip to content

Commit 19b59c0

Browse files
committed
more updated documentation
1 parent 90e5c0f commit 19b59c0

File tree

4 files changed

+66
-13
lines changed

4 files changed

+66
-13
lines changed

Extensions/Cosmos/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Source supports an optional `IncludeMetadataFields` parameter (`false` by defaul
1414
### Source
1515

1616
```json
17-
"CosmosSourceSettings": {
17+
{
1818
"ConnectionString": "AccountEndpoint=https://...",
1919
"Database":"myDb",
2020
"Container":"myContainer",
@@ -29,7 +29,7 @@ Sink requires an additional `PartitionKeyPath` parameter which is used when crea
2929
### Sink
3030

3131
```json
32-
"CosmosSinkSettings": {
32+
{
3333
"ConnectionString": "AccountEndpoint=https://...",
3434
"Database":"myDb",
3535
"Container":"myContainer",

Extensions/Json/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Source and sink settings both require a `FilePath` parameter, which should speci
99
### Source
1010

1111
```json
12-
"JsonSourceSettings": {
12+
{
1313
"FilePath": ""
1414
}
1515

@@ -18,7 +18,7 @@ Source and sink settings both require a `FilePath` parameter, which should speci
1818
### Sink
1919

2020
```json
21-
"JsonSinkSettings": {
21+
{
2222
"FilePath": "",
2323
"Indented": true
2424
}

Extensions/Mongo/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Source and sink settings require both `ConnectionString` and `DatabaseName` para
99
### Source
1010

1111
```json
12-
"MongoSourceSettings": {
12+
{
1313
"ConnectionString": "",
1414
"DatabaseName: "",
1515
"Collection": ""
@@ -19,7 +19,7 @@ Source and sink settings require both `ConnectionString` and `DatabaseName` para
1919
### Sink
2020

2121
```json
22-
"MongoSinkSettings": {
22+
{
2323
"ConnectionString": "",
2424
"DatabaseName: "",
2525
"Collection": "",

README.md

+60-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To access the archived version of the tool, navigate to the [**Archive branch**]
2525
- [Task 1: Provision a sample database and container using the Azure Cosmos DB Emulator as the destination(sink)](#task-1-provision-a-sample-database-and-container-using-the-azure-cosmos-db-emulator-as-the-destinationsink)
2626
- [Task 2: Prepare JSON source documents](#task-2-prepare-json-source-documents)
2727
- [Task 3: Setup the data migration configuration](#task-3-setup-the-data-migration-configuration)
28-
- [Tutorial: Using the command line](#tutorial-using-the-command-line)
28+
- [Using the command line](#using-the-command-line)
2929
- [Creating Extensions](#creating-extensions)
3030
- [Extension documentation](#extension-documentation)
3131

@@ -104,14 +104,14 @@ This tutorial outlines how to use the Cosmos DB Data Migration tool to move JSON
104104

105105
1. Each extension contains a README document that outlines configuration for the data migration. In this case, locate the configuration for [JSON (Source)](https://github.com/Azure/azure-documentdb-datamigrationtool/tree/feature/begin-core/Extensions/Json/Cosmos.DataTransfer.JsonExtension) and [Cosmos DB (Sink)](https://github.com/Azure/azure-documentdb-datamigrationtool/tree/feature/begin-core/Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension).
106106

107-
2. In the Visual Studio Solution Explorer, expand the **Microsoft.Data.Transfer.Core** project, and open **appsettings.json**. This file provides an example outline of the settings file structure. Using the documentation linked above, configure the **JsonSourceSettings** and **Cosmos-NoSqlSinkSettings** sections. Ensure the **FilePath** setting is the location where the sample data is extracted. The ConnectionString setting can be found on the Cosmos DB Emulator **Quickstart** screen as the **Primary Connection String**. Save the file.
107+
2. In the Visual Studio Solution Explorer, expand the **Microsoft.Data.Transfer.Core** project, and open **migrationsettings.json**. This file provides an example outline of the settings file structure. Using the documentation linked above, configure the **JsonSourceSettings** and **Cosmos-NoSqlSinkSettings** sections. Ensure the **FilePath** setting is the location where the sample data is extracted. The ConnectionString setting can be found on the Cosmos DB Emulator **Quickstart** screen as the **Primary Connection String**. Save the file.
108108

109109
```json
110110
{
111-
"JSONSourceSettings": {
111+
"SourceSettings": {
112112
"FilePath": "C:\\btcdata\\simple_json.json"
113113
},
114-
"Cosmos-NoSqlSinkSettings": {
114+
"SinkSettings": {
115115
"ConnectionString": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDj...",
116116
"Database": "datamigration",
117117
"Container": "btcdata",
@@ -126,21 +126,74 @@ This tutorial outlines how to use the Cosmos DB Data Migration tool to move JSON
126126

127127
3. Ensure the **Cosmos.DataTransfer.Core** project is set as the startup project then press <kbd>F5</kbd> to run the application.
128128

129-
4. The application will load the provided extensions, then prompt for a **Source**. Select **JSON**. When prompted to load settings from a file enter `n` and press <kbd>Enter</kbd>. The application provides the ability to configure extensions in a separate file versus having them located in the **appsettings.json** file. When a separate file is not specified, the settings are read from **appsettings.json**. When prompted to provide the Configuration section name, press <kbd>Enter</kbd> to accept the default: **JSONSourceSettings**.
129+
4. The application will load the provided extensions, then prompt for a **Source**. Select **JSON**. When prompted to load settings from a file enter `n` and press <kbd>Enter</kbd>. The application provides the ability to configure extensions in a separate file versus having them located in the **migrationsettings.json** file. When a separate file is not specified, the settings are read from **migrationsettings.json**. When prompted to provide the Configuration section name, press <kbd>Enter</kbd> to accept the default: **JSONSourceSettings**.
130130

131131
![The Data Migration application displays with a menu prompt for Source.](media/app_source_prompt.png "Select Source")
132132

133-
5. The application will then prompt for a **Sink**, choose **Cosmos-nosql**. When prompted to load settings from a file enter `n` and press <kbd>Enter</kbd>. The application provides the ability to configure extensions in a separate file versus having them located in the **appsettings.json** file. When a separate file is not specified, the settings are read from **appsettings.json**. When prompted to provide the Configuration section name, press <kbd>Enter</kbd> to accept the default: **Cosmos-NoSqlSinkSettings**.
133+
>**Note**: Alternatively, to avoid this prompt add the **Source** property to the configuration with the value **Json** (matching the **DisplayName** property of the extension)
134+
135+
5. The application will then prompt for a **Sink**, choose **Cosmos-nosql**. When prompted to load settings from a file enter `n` and press <kbd>Enter</kbd>. The application provides the ability to configure extensions in a separate file versus having them located in the **migrationsettings.json** file. When a separate file is not specified, the settings are read from **migrationsettings.json**. When prompted to provide the Configuration section name, press <kbd>Enter</kbd> to accept the default: **Cosmos-NoSqlSinkSettings**.
134136

135137
![The Data migration application displays with a menu prompt for Sink.](media/app_sink_prompt.png "Select Sink")
136138

139+
>**Note**: Alternatively, to avoid this prompt add the **Sink** property to the configuration with the value **Cosmos-nosql** (matching the **DisplayName** property of the extension)
140+
137141
6. The application then performs the data migration. After a few moments the process will indicate **Done.**.
138142

139143
![The Data migration application displays with the full output of the migration including the Done message.](media/app_final.png "Data Migration completes")
140144

141-
## Tutorial: Using the command line
145+
Example of `migrationsettings.json` with **Source** and **Sink** configured.
146+
147+
```json
148+
{
149+
"Source": "JSON",
150+
"Sink": "Cosmos-nosql",
151+
"SourceSettings": {
152+
"FilePath": "C:\\btcdata\\simple_json.json"
153+
},
154+
"SinkSettings": {
155+
"ConnectionString": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDj...",
156+
"Database": "datamigration",
157+
"Container": "btcdata",
158+
"PartitionKeyPath": "/id",
159+
"RecreateContainer": false,
160+
"IncludeMetadataFields": false
161+
}
162+
}
163+
```
164+
165+
## Using the command line
166+
167+
1. Ensure the project is [built](#build-the-solution).
168+
169+
2. The **Extensions** folder contains the plug-ins available for use in the migration. Each extension is located in a folder with the name of the data source. For example, the Cosmos DB extension is located in the folder **Cosmos**. Before running the application, you can open the **Extensions** folder and remove any folders for the extensions that are not required for the migration.
170+
171+
3. In the root of the build folder, locate the **migrationsettings.json** and update settings as documented in the (Extension documentation)(#extension-documentation). Example file (similar to tutorial above):
172+
173+
```json
174+
{
175+
"Source": "JSON",
176+
"Sink": "Cosmos-nosql",
177+
"SourceSettings": {
178+
"FilePath": "C:\\btcdata\\simple_json.json"
179+
},
180+
"SinkSettings": {
181+
"ConnectionString": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDj...",
182+
"Database": "datamigration",
183+
"Container": "btcdata",
184+
"PartitionKeyPath": "/id",
185+
"RecreateContainer": false,
186+
"IncludeMetadataFields": false
187+
}
188+
}
189+
```
142190

191+
4. Execute the program using the following command:
143192

193+
```bash
194+
dmt.exe
195+
```
196+
> **Note**: Use the `--settings` option with a file path to specify a different settings file (overriding the default **migrationsettings.json** file). This facilitates automating running of different migration jobs in a programmatic loop.
144197

145198
## Creating Extensions
146199

0 commit comments

Comments
 (0)