|
1 |
| -# dataverse-configuration-migration-tool |
2 |
| -Custom .net cli tool to import configuration data into a dataverse environment |
| 1 | + |
3 | 2 |
|
| 3 | +# Dataverse Configuration Migration Tool |
| 4 | + |
| 5 | +This repository contains a custom .NET CLI tool designed to import configuration data into Microsoft Dataverse environments. It streamlines the migration of configuration data, supports schema validation, and offers extensibility for advanced scenarios. |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- Import configuration data into Dataverse |
| 10 | +- Schema validation and rule-based checks |
| 11 | +- Support for special characters and self-hierarchy imports |
| 12 | +- Extensible for custom validation and reporting |
| 13 | + |
| 14 | +## Getting Started |
| 15 | + |
| 16 | +### Prerequisites |
| 17 | + |
| 18 | +- [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) |
| 19 | +- Access to a Microsoft Dataverse environment |
| 20 | + |
| 21 | +### Building the Tool |
| 22 | + |
| 23 | +1. Clone the repository: |
| 24 | + ```powershell |
| 25 | + git clone https://github.com/dotnetprog/dataverse-configuration-migration-tool.git |
| 26 | + cd dataverse-configuration-migration-tool/src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.Console |
| 27 | + ``` |
| 28 | +2. Build the project: |
| 29 | + ```powershell |
| 30 | + dotnet build |
| 31 | + ``` |
| 32 | + |
| 33 | +### Usage |
| 34 | + |
| 35 | + |
| 36 | +Before running the tool, set your `clientId`, `clientSecret` and `url` securely using [dotnet user-secrets](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets): |
| 37 | + |
| 38 | +```powershell |
| 39 | +cd src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.Console |
| 40 | +dotnet user-secrets set "Dataverse:ClientId" "<your-client-id>" |
| 41 | +dotnet user-secrets set "Dataverse:ClientSecret" "<your-client-secret>" |
| 42 | +dotnet user-secrets set "Dataverse:Url" "<your-env-url>" |
| 43 | +``` |
| 44 | + |
| 45 | +Run the CLI tool with the required arguments (no need to pass clientId or clientSecret on the command line): |
| 46 | + |
| 47 | +```powershell |
| 48 | +dotnet run --project Dataverse.ConfigurationMigrationTool.Console -- import --data "path/to/data.xml" --schema "path/to/schema.xml" |
| 49 | +``` |
| 50 | + |
| 51 | +#### Import Command Line Arguments |
| 52 | + |
| 53 | +Verb: `import` |
| 54 | +- `--data` : Path to the data xml file |
| 55 | +- `--schema` : Path to the schema XML file |
| 56 | + |
| 57 | +Additional options and advanced usage can be found by running `dotnet run -- --help`. |
| 58 | + |
| 59 | +## Contributing |
| 60 | + |
| 61 | +Contributions are welcome! To get started: |
| 62 | + |
| 63 | +1. Fork the repository and create a new branch for your feature or bugfix. |
| 64 | +2. Make your changes and add tests as appropriate. |
| 65 | +3. Ensure all tests pass: |
| 66 | + ```powershell |
| 67 | + dotnet test ../Console.Tests/Dataverse.ConfigurationMigrationTool.Console.Tests.csproj |
| 68 | + ``` |
| 69 | +4. Submit a pull request with a clear description of your changes. |
| 70 | + |
| 71 | +Please review open issues and the todo list below for ideas on what to contribute. |
| 72 | + |
| 73 | + |
| 74 | +### Generating Schema and Data Files |
| 75 | + |
| 76 | +To use the `import` command, you need a schema file and a data file. These can be generated from your Dataverse environment using the official Configuration Migration tool. For detailed instructions, refer to the Microsoft documentation: |
| 77 | + |
| 78 | +- [Create a schema and export configuration data](https://learn.microsoft.com/en-us/power-platform/admin/create-schema-export-configuration-data) |
| 79 | + |
| 80 | +This guide explains how to: |
| 81 | +- Create a schema file that defines the data to export |
| 82 | +- Export configuration data from your environment |
| 83 | + |
| 84 | +*__NOTE__*: the `data_schema.xml` and `data.xml` will be inside the exported zip. You need to extract those files and use them to import command as described above. |
4 | 85 |
|
5 |
| -## Todo list: |
6 | 86 |
|
7 |
| -- Functionnal testing for self hierarchy import jobs.✅ |
8 |
| -- Add support for special characters. ✅ |
9 |
| -- <del> Add support to map users to owner.</del> |
10 |
| -- <del>Add support to map created on to OverrideCreatedOn.</del> |
11 |
| -- Refactor Schema validations into multiple validation rules |
12 |
| -- Add configuration for tool reporting |
13 |
| -- Add unit tests for everything |
14 |
| -- Add CI/CD pipeline to build and execute the tool. |
|
0 commit comments