├── .attachments ├── ConfigFileScreen.jpg ├── ConfirmExportFolder.jpg ├── DemoScenariosScreen.jpg ├── ExecuteConfirm.jpg ├── ExecutionComplete.jpg ├── ImportConfirm.jpg ├── LatestReleaseScreen.jpg ├── UnblockZipScreen.jpg ├── nugetScreen.png ├── obfuscationDemoScenario.png ├── outputFilesExample.png └── solutionView.png ├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .runsettings ├── CONTRIBUTING.md ├── Capgemini.Xrm.DataMigration.sln ├── GitVersion.yml ├── GlobalSuppressions.cs ├── LICENSE ├── NuGet.config ├── README.md ├── azure-pipelines-pull-request.yml ├── azure-pipelines.yml ├── samples ├── App.config ├── Capgemini.Xrm.DataMigration.Samples.GeneratedMSBuildEditorConfig.editorconfig ├── Capgemini.Xrm.DataMigration.Samples.csproj ├── ConsoleLogger.cs ├── DemoScenarios │ ├── BusinessUnits │ │ ├── ExportConfig.json │ │ ├── ImportConfig.json │ │ └── Schema.xml │ ├── Calendars │ │ ├── ExportConfig.json │ │ ├── ImportConfig.json │ │ └── Schema.xml │ ├── Contacts │ │ └── Schema.xml │ ├── CrmPortals │ │ ├── ExportConfig.json │ │ ├── ImportConfig.json │ │ └── Schema.xml │ ├── DuplicateDetection │ │ ├── ExportConfig.json │ │ ├── ImportConfig.json │ │ └── schema.xml │ ├── FieldServiceConfig │ │ ├── ExportConfig.json │ │ ├── ImportConfig.json │ │ └── Schema.xml │ ├── ManyToMany │ │ └── Schema.xml │ ├── Obfuscation │ │ ├── ImportConfig.json │ │ ├── LookupFiles │ │ │ ├── FirstnameAndSurnames.csv │ │ │ └── ukpostcodes.csv │ │ └── Schema.xml │ ├── OneToMany │ │ └── Schema.xml │ ├── OrgSettings │ │ └── Schema.xml │ ├── OrganizationHierarchy │ │ ├── ExportConfig.json │ │ ├── ImportConfig.json │ │ └── Schema.xml │ ├── ServiceBusSettings │ │ ├── ExportConfig.json │ │ ├── ImportConfig.json │ │ └── Schema.xml │ ├── SubjectsAndArticles │ │ ├── ExportConfig.json │ │ ├── ImportConfig.json │ │ └── Schema.xml │ └── UsersAndRoles │ │ ├── ExportConfig.json │ │ ├── ImportConfig.json │ │ └── Schema.xml ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Settings.Designer.cs │ └── Settings.settings └── packages.config ├── src ├── Capgemini.DataMigration.Core │ ├── Attributes │ │ └── ValidatedNotNullAttribute.cs │ ├── Cache │ │ └── SimpleMemoryCache.cs │ ├── Capgemini.DataMigration.Core.GeneratedMSBuildEditorConfig.editorconfig │ ├── Capgemini.DataMigration.Core.csproj │ ├── Capgemini.DataMigration.Core.ruleset │ ├── ConsoleLogger.cs │ ├── DataStore │ │ └── MigrationEntityWrapper.cs │ ├── Exceptions │ │ ├── ConfigurationException.cs │ │ └── ValidationException.cs │ ├── Extensions │ │ └── ExceptionExtensions.cs │ ├── GenericDataMigrator.cs │ ├── Helpers │ │ └── ObfuscationLookupHelper.cs │ ├── IDataStoreReader.cs │ ├── IDataStoreWriter.cs │ ├── IEntityProcessor.cs │ ├── IGenericDataMigrator.cs │ ├── ILogger.cs │ ├── Model │ │ ├── EntityToBeObfuscated.cs │ │ ├── FieldToBeObfuscated.cs │ │ ├── ObfuscationFormatOption.cs │ │ ├── ObfuscationFormatType.cs │ │ └── ObfuscationLookup.cs │ ├── OperationType.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resiliency │ │ ├── IPolicyBuilder.cs │ │ └── IRetryExecutor.cs │ ├── app.config │ └── packages.config ├── Capgemini.DataMigration.Resiliency.Polly │ ├── Capgemini.DataMigration.Resiliency.Polly.GeneratedMSBuildEditorConfig.editorconfig │ ├── Capgemini.DataMigration.Resiliency.Polly.csproj │ ├── Capgemini.DataMigration.Resiliency.Polly.ruleset │ ├── GlobalSuppressions1.cs │ ├── PollyFluentPolicy.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ServiceRetryExecutor.cs │ ├── app.config │ └── packages.config ├── Capgemini.DataScrambler │ ├── Capgemini.DataScrambler.GeneratedMSBuildEditorConfig.editorconfig │ ├── Capgemini.DataScrambler.csproj │ ├── Factories │ │ └── ScramblerClientFactory.cs │ ├── GlobalSuppressions1.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ScramblerClient.cs │ ├── Scramblers │ │ ├── DecimalScrambler.cs │ │ ├── DoubleScrambler.cs │ │ ├── EmailScambler.cs │ │ ├── GuidScrambler.cs │ │ ├── IScrambler.cs │ │ ├── IntegerScrambler.cs │ │ ├── RandomGenerator.cs │ │ └── StringScrambler.cs │ ├── app.config │ └── packages.config ├── Capgemini.Xrm.DataMigration.Cli │ ├── App.config │ ├── Capgemini.Xrm.DataMigration.Cli.GeneratedMSBuildEditorConfig.editorconfig │ ├── Capgemini.Xrm.DataMigration.Cli.csproj │ ├── Capgemini.Xrm.DataMigration.Cli.nuspec │ ├── Capgemini.Xrm.DataMigration.Cli.ruleset │ ├── ExportOptions.cs │ ├── ImportOptions.cs │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── Capgemini.Xrm.DataMigration.Core │ ├── Cache │ │ └── EntityMetadataCache.cs │ ├── Capgemini.Xrm.DataMigration.Core.GeneratedMSBuildEditorConfig.editorconfig │ ├── Capgemini.Xrm.DataMigration.Core.csproj │ ├── Capgemini.Xrm.DataMigration.Core.ruleset │ ├── Config │ │ ├── CrmSchemaConfiguration.cs │ │ ├── ICrmGenericImporterConfig.cs │ │ ├── ICrmStoreReaderConfig.cs │ │ ├── ICrmStoreWriterConfig.cs │ │ ├── IFileStoreReaderConfig.cs │ │ ├── IFileStoreWriterConfig.cs │ │ ├── JsonSerializerConfig.cs │ │ ├── MappingConfiguration.cs │ │ └── ObjectTypeCodeMappingConfiguration.cs │ ├── DataStore │ │ └── EntityWrapper.cs │ ├── Extensions │ │ ├── ExecuteMultipleResponseItemExtensions.cs │ │ ├── FetchExpressionExtensions.cs │ │ └── OrgServiceExtensions.cs │ ├── GenericCrmDataMigrator.cs │ ├── Helpers │ │ └── JsonHelper.cs │ ├── IEntityMetadataCache.cs │ ├── IEntityRepository.cs │ ├── IGenericCrmDataMigrator.cs │ ├── IMappingFetchCreator.cs │ ├── IMappingRule.cs │ ├── IProcessRepository.cs │ ├── Model │ │ ├── CrmEntity.cs │ │ ├── CrmField.cs │ │ ├── CrmRelationship.cs │ │ ├── EntityFields.cs │ │ ├── ManyToManyDetails.cs │ │ ├── PassType.cs │ │ ├── SDKStepStatusCode.cs │ │ ├── SdkStep.cs │ │ ├── SdkStepState1.cs │ │ ├── WorkflowCategory.cs │ │ ├── WorkflowEntity.cs │ │ ├── WorkflowState.cs │ │ ├── WorkflowStatusCode.cs │ │ └── WorkflowType.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Repositories │ │ ├── EntityRepository.cs │ │ ├── EntityRepositorySingle.cs │ │ └── ProcessRepository.cs │ ├── app.config │ └── packages.config ├── Capgemini.Xrm.DataMigration.CrmStore │ ├── Capgemini.Xrm.DataMigration.CrmStore.GeneratedMSBuildEditorConfig.editorconfig │ ├── Capgemini.Xrm.DataMigration.CrmStore.csproj │ ├── Capgemini.Xrm.DataMigration.CrmStore.ruleset │ ├── Config │ │ ├── CrmExporterConfig.cs │ │ ├── CrmGenericImporterConfig.cs │ │ ├── CrmImportConfig.cs │ │ ├── CrmStoreReaderConfig.cs │ │ └── CrmStoreWriterConfig.cs │ ├── DataStores │ │ ├── DataCrmStoreReader.cs │ │ ├── DataCrmStoreWriter.cs │ │ └── DataCrmStoreWriterMultiThreaded.cs │ ├── FetchCreators │ │ ├── BusinessUnitRootFetchCreator.cs │ │ └── MappingAliasedValueFetchCreator.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ └── packages.config ├── Capgemini.Xrm.DataMigration.Engine │ ├── Capgemini.Xrm.DataMigration.Engine.GeneratedMSBuildEditorConfig.editorconfig │ ├── Capgemini.Xrm.DataMigration.Engine.csproj │ ├── Capgemini.Xrm.DataMigration.Engine.nuspec │ ├── Capgemini.Xrm.DataMigration.Engine.ruleset │ ├── CrmDirectMigrator.cs │ ├── CrmFileDataExporter.cs │ ├── CrmFileDataExporterCsv.cs │ ├── CrmFileDataImporter.cs │ ├── CrmFileDataImporterCsv.cs │ ├── CrmGenericImporter.cs │ ├── DataProcessors │ │ ├── EntityStatusProcessor.cs │ │ ├── IgnoredFieldsProcessor.cs │ │ ├── MapEntityProcessor.cs │ │ ├── NoUpdateProcessor.cs │ │ ├── ObfuscateFieldsProcessor.cs │ │ ├── ObjectTypeCodeProcessor.cs │ │ ├── PassZeroReferenceProcessor.cs │ │ ├── ReferenceFieldsProcessor.cs │ │ ├── SyncEntitiesProcessor.cs │ │ └── WorkflowsPluginsProcessor.cs │ ├── GlobalSuppressions1.cs │ ├── MappingRules │ │ ├── BusinessUnitRootRule.cs │ │ └── MappingAliasedValueRule.cs │ ├── Obfuscate │ │ ├── CrmObfuscateDecimalHandler.cs │ │ ├── CrmObfuscateDoubleHandler.cs │ │ ├── CrmObfuscateIntHandler.cs │ │ ├── CrmObfuscateStringHandler.cs │ │ ├── ICrmObfuscateHandler.cs │ │ └── ObfuscationType │ │ │ └── Formatting │ │ │ ├── FormattingOptions │ │ │ ├── FormattingOptionLookup.cs │ │ │ └── FormattingOptionProcessor.cs │ │ │ ├── IObfuscationFormattingType.cs │ │ │ ├── ObfuscationFormattingDouble.cs │ │ │ └── ObfuscationFormattingString.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Repositories │ │ └── OrgServiceExtensions.cs │ ├── app.config │ └── packages.config └── Capgemini.Xrm.DataMigration.FileStore │ ├── Capgemini.Xrm.DataMigration.FileStore.GeneratedMSBuildEditorConfig.editorconfig │ ├── Capgemini.Xrm.DataMigration.FileStore.csproj │ ├── Capgemini.Xrm.DataMigration.FileStore.ruleset │ ├── Config │ ├── FileStoreReaderConfig.cs │ └── FileStoreWriterConfig.cs │ ├── DataStore │ ├── DataFileStoreReader.cs │ ├── DataFileStoreReaderCsv.cs │ ├── DataFileStoreWriter.cs │ └── DataFileStoreWriterCsv.cs │ ├── Helpers │ ├── EntityConverterHelper.cs │ └── ReadCsvHelper.cs │ ├── Model │ ├── CrmAttributeStore.cs │ ├── CrmEntityStore.cs │ └── CrmExportedDataStore.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── app.config │ └── packages.config ├── stylecop.json ├── templates └── commonbuildtasks.yml └── tests ├── Capgemini.DataMigration.Core.Tests.Base ├── Capgemini.DataMigration.Core.Tests.Base.GeneratedMSBuildEditorConfig.editorconfig ├── Capgemini.DataMigration.Core.Tests.Base.csproj ├── Helpers │ └── FileManager.cs ├── Properties │ └── AssemblyInfo.cs ├── TestMigrationEntityWrapper.cs ├── TestOrganizationalService.cs ├── TestRetryExecutor.cs ├── UnitTestBase.cs ├── app.config └── packages.config ├── Capgemini.DataMigration.Core.Tests.Unit ├── Capgemini.DataMigration.Core.Tests.Unit.GeneratedMSBuildEditorConfig.editorconfig ├── Capgemini.DataMigration.Core.Tests.Unit.csproj ├── ConsoleLoggerTests.cs ├── Exceptions │ └── ConfigurationExceptionTests.cs ├── Extensions │ └── ExceptionExtensionsTests.cs ├── GenericDataMigratorTests.cs ├── Helpers │ └── ObfuscationLookupHelperShould.cs ├── Model │ ├── FieldToBeObfuscatedTests.cs │ ├── ObfuscationFormatOptionTests.cs │ └── ObfuscationLookupTests.cs ├── Properties │ └── AssemblyInfo.cs ├── TestData │ └── LookupFiles │ │ ├── EmptyFolder │ │ └── EmptyFile.txt │ │ ├── FirstnameAndSurnames.csv │ │ └── ukpostcodes.csv ├── app.config └── packages.config ├── Capgemini.DataScrambler.Tests.Unit ├── Capgemini.DataScrambler.Tests.Unit.GeneratedMSBuildEditorConfig.editorconfig ├── Capgemini.DataScrambler.Tests.Unit.csproj ├── Factories │ └── ScramblerClientFactoryTests.cs ├── Properties │ └── AssemblyInfo.cs ├── ScramblerClientTests.cs ├── Scramblers │ ├── DecimalScramblerTests.cs │ ├── DoubleScramblerTests.cs │ ├── EmailScamblerTests.cs │ ├── GuidScramblerTests.cs │ ├── IntegerScramblerTests.cs │ └── StringScramblerTests.cs ├── app.config └── packages.config ├── Capgemini.Xrm.DataMigration.Core.IntegrationTests ├── Capgemini.Xrm.DataMigration.Core.IntegrationTests.GeneratedMSBuildEditorConfig.editorconfig ├── Capgemini.Xrm.DataMigration.Core.IntegrationTests.csproj ├── EntityMetadataCacheTest.cs ├── ExtensionTests │ └── OrgServiceExtensionsTest.cs ├── Helpers │ ├── ConnectionHelper.cs │ ├── EntityMockHelper.cs │ └── RetryMockHelper.cs ├── Properties │ └── AssemblyInfo.cs ├── app.config └── packages.config ├── Capgemini.Xrm.DataMigration.Core.Tests.Unit ├── Cache │ └── EntityMetadataCacheTests.cs ├── Capgemini.Xrm.DataMigration.Core.Tests.Unit.GeneratedMSBuildEditorConfig.editorconfig ├── Capgemini.Xrm.DataMigration.Core.Tests.Unit.csproj ├── Exceptions │ └── ValidationExceptionTests.cs ├── Extensions │ ├── ExecuteMultipleResponseItemExtensionsTests.cs │ ├── FetchExpressionExtensionsTests.cs │ └── OrgServiceExtensionsTests.cs ├── Model │ └── CrmEntityTests.cs ├── Properties │ └── AssemblyInfo.cs ├── Repositories │ ├── EntityRepositorySingleTests.cs │ └── EntityRepositoryTests.cs ├── TestData │ └── CrmEntity.xml ├── app.config └── packages.config ├── Capgemini.Xrm.DataMigration.CrmStore.Tests.Unit ├── Capgemini.Xrm.DataMigration.CrmStore.Tests.Unit.GeneratedMSBuildEditorConfig.editorconfig ├── Capgemini.Xrm.DataMigration.CrmStore.Tests.Unit.csproj ├── Config │ ├── CrmConfigTest.cs │ ├── CrmExporterConfigTests.cs │ ├── CrmImportConfigTests.cs │ └── CrmStoreReaderConfigTests.cs ├── DataStores │ ├── DataCrmStoreReaderTests.cs │ ├── DataCrmStoreWriterMultiThreadedTests.cs │ └── DataCrmStoreWriterTests.cs ├── FetchCreators │ ├── BusinessUnitRootFetchCreatorTests.cs │ └── MappingAliasedValueFetchCreatorTests.cs ├── Properties │ └── AssemblyInfo.cs ├── TestData │ ├── ExportConfig.json │ ├── ImportConfig.json │ ├── ImportSchemas │ │ ├── BusinessUnitSchema.xml │ │ └── TestDataSchema │ │ │ ├── testschemafile.xml │ │ │ └── usersettingsschema.xml │ ├── PostDeployDataExport.json │ ├── PostDeployDataImport.json │ └── usersettingsschema.xml ├── app.config └── packages.config ├── Capgemini.Xrm.DataMigration.Engine.Tests.Unit ├── Capgemini.Xrm.DataMigration.Engine.Tests.Unit.GeneratedMSBuildEditorConfig.editorconfig ├── Capgemini.Xrm.DataMigration.Engine.Tests.Unit.csproj ├── CrmDirectMigratorTests.cs ├── CrmFileDataExporterCsvTests.cs ├── CrmFileDataExporterTests.cs ├── CrmFileDataImporterCsvTests.cs ├── CrmFileDataImporterTests.cs ├── DataProcessors │ ├── EntityStatusProcessorTests.cs │ ├── IgnoredFieldsProcessorTests.cs │ ├── MapEntityProcessorTests.cs │ ├── NoUpdateProcessorTests.cs │ ├── ObfuscateFieldsProcessorTests.cs │ ├── ObjectTypeCodeProcessorTests.cs │ ├── PassZeroReferenceProcessorTests.cs │ ├── ReferenceFieldsProcessorTests.cs │ ├── SyncEntitiesProcessorTests.cs │ └── WorkflowsPluginsProcessorTests.cs ├── Implementation │ ├── CrmGenericImporterAddCustomProcessorsTest.cs │ ├── CrmGenericImporterZeroPassTest.cs │ ├── CrmRetryExecutorTest.cs │ ├── PollyRetryBuilderTests.cs │ └── TestCrmGenericImporter.cs ├── MappingRules │ ├── BusinessUnitRootRuleTests.cs │ └── MappingAliasedValueRuleTests.cs ├── Obfuscate │ ├── CrmObfuscateDoubleHandlerShould.cs │ ├── CrmObfuscateStringHandlerShould.cs │ └── ObfuscationType │ │ └── Formatting │ │ ├── FormattingOptions │ │ ├── FormattingOptionProcessorGenerateFromLookupShould.cs │ │ ├── FormattingOptionProcessorGenerateRandomNumberShould.cs │ │ └── FormattingOptionProcessorGenerateRandomStringShould.cs │ │ ├── ObfuscationFormattingDoubleShould.cs │ │ └── ObfuscationFormattingStringShould.cs ├── Properties │ └── AssemblyInfo.cs ├── TestData │ ├── ExportConfig.json │ ├── ImportConfig.json │ └── LookupFiles │ │ ├── EmptyFolder │ │ └── EmptyFile.txt │ │ ├── FirstnameAndSurnames.csv │ │ └── ukpostcodes.csv ├── app.config └── packages.config ├── Capgemini.Xrm.DataMigration.FileStore.Tests.Unit ├── Capgemini.Xrm.DataMigration.FileStore.Tests.Unit.GeneratedMSBuildEditorConfig.editorconfig ├── Capgemini.Xrm.DataMigration.FileStore.Tests.Unit.csproj ├── Config │ ├── FileStoreReaderConfigTests.cs │ └── FileStoreWriterConfigTests.cs ├── Core │ └── TestBase.cs ├── DataStore │ ├── DataFileStoreReaderCsvTests.cs │ ├── DataFileStoreReaderTests.cs │ ├── DataFileStoreWriterCsvTests.cs │ └── DataFileStoreWriterTests.cs ├── Helpers │ └── EntityConverterHelperTests.cs ├── Model │ ├── CrmAttributeStoreTests.cs │ ├── CrmEntityStoreTests.cs │ └── CrmExportedDataStoreTests.cs ├── Properties │ └── AssemblyInfo.cs ├── TestData │ ├── ExtractedData │ │ ├── ErrorFilePrefix_contact_1.csv │ │ ├── ExportedDataSystemUser_systemuser_1.csv │ │ ├── ExportedDataSystemUser_systemuser_1.json │ │ ├── ExportedDataTeamMem_teammembership_1.csv │ │ ├── ExportedDataTeamMem_teammembership_1.json │ │ ├── ExportedDataUserProfile_systemuserprofiles_1.csv │ │ ├── ExportedDataUserProfile_systemuserprofiles_1.json │ │ ├── ExportedDataUserRole_systemuserroles_1.csv │ │ ├── ExportedDataUserRole_systemuserroles_1.json │ │ ├── ExportedDataUserSet_usersettings_1.csv │ │ ├── ExportedDataUserSet_usersettings_1.json │ │ └── ValidFilePrefix_contact_1.csv │ ├── UserSettingsExportConfig.json │ └── usersettingsschema.xml ├── app.config └── packages.config └── Capgemini.Xrm.DataMigration.Tests.Integration ├── Capgemini.Xrm.DataMigration.Tests.Integration.GeneratedMSBuildEditorConfig.editorconfig ├── Capgemini.Xrm.DataMigration.Tests.Integration.csproj ├── DataMigration ├── DataStoreTests │ ├── DataCrmStoreReaderWriterTest.cs │ └── DataFileStoreReaderWriterTest.cs ├── EntityMetadataCacheTest.cs ├── EntityRepositoryTest.cs └── MigrationTests │ ├── CrmFileMigrationAppointmentsTest.cs │ ├── CrmFileMigrationBaseTest.cs │ ├── CrmFileMigrationBusinessUnitTests.cs │ ├── CrmFileMigrationCallendarTests.cs │ ├── CrmFileMigrationContactWithObfuscationTest.cs │ ├── CrmFileMigrationContactWithOwnerTest.cs │ ├── CrmFileMigrationCrmPortalsTests.cs │ ├── CrmFileMigrationCustomSolutionTests.cs │ ├── CrmFileMigrationKBArticlesTests.cs │ ├── CrmFileMigrationMarketingListTests.cs │ ├── CrmFileMigrationMultiOptionSetTests.cs │ ├── CrmFileMigrationRolesTeamsRelationshipTests.cs │ ├── CrmFileMigrationServiceEndpointTests.cs │ ├── CrmFileMigrationTeamsTests.cs │ ├── CrmFileMigrationTestDataTests.cs │ └── CrmFileMigrationUserSettingsTest.cs ├── Helpers ├── ConnectionHelper.cs ├── EntityMockHelper.cs ├── EntityRepositoryFake.cs └── FileManager.cs ├── Processors ├── ObfuscateFieldsProcessorTests.cs └── WorkflowsPluginsProcessorTest.cs ├── ProcessorsUnitTests ├── DeleteEntitiesProcessorTest.cs └── EntityStatusProcessorTests.cs ├── Properties └── AssemblyInfo.cs ├── SerializationTests └── SchemaFileTest.cs ├── TestData ├── ExportConfig.json ├── ExtractedData │ ├── ExportedDataSystemUser_systemuser_1.csv │ ├── ExportedDataSystemUser_systemuser_1.json │ ├── ExportedDataTeamMem_teammembership_1.csv │ ├── ExportedDataTeamMem_teammembership_1.json │ ├── ExportedDataUserProfile_systemuserprofiles_1.csv │ ├── ExportedDataUserProfile_systemuserprofiles_1.json │ ├── ExportedDataUserRole_systemuserroles_1.csv │ ├── ExportedDataUserRole_systemuserroles_1.json │ ├── ExportedDataUserSet_usersettings_1.csv │ └── ExportedDataUserSet_usersettings_1.json ├── FetchXmlFolder │ └── contact.xml ├── ImportConfig.json ├── ImportSchemas │ ├── AppointmentsSchema │ │ └── apointmentsSchema.xml │ ├── BusinessUnits │ │ └── BusinessUnitSchema.xml │ ├── CallendarSettings │ │ └── callendarSchema.xml │ ├── ContactSchema │ │ └── ContactSchemaWithOwner.xml │ ├── CrmPortal │ │ ├── CrmPortalFullSchema.xml │ │ └── CrmPortalFullSchemaWithNotes.xml │ ├── CustomSolutionSchema │ │ ├── CustomSolutionSchema.xml │ │ └── DataTest_1_0_0_0.zip │ ├── KBSchema │ │ └── KBSchema.xml │ ├── MarketingList │ │ └── MarketingListDataSchema.xml │ ├── MultiOptionSet │ │ └── multioptionsetschema.xml │ ├── RolesTeamsRelationship │ │ └── teamsrolesschema.xml │ ├── ServiceEndpoint │ │ └── serviceendpointschema.xml │ ├── TeamSchema │ │ └── TeamsSchema.xml │ ├── TestDataSchema │ │ ├── testschemafile.xml │ │ └── usersettingsschema.xml │ └── UserSettings │ │ └── usersettingsschema.xml ├── UserSettingsExportConfig.json ├── testschemafile.xml └── usersettingsschema.xml ├── app.config └── packages.config /.attachments/ConfigFileScreen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/ConfigFileScreen.jpg -------------------------------------------------------------------------------- /.attachments/ConfirmExportFolder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/ConfirmExportFolder.jpg -------------------------------------------------------------------------------- /.attachments/DemoScenariosScreen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/DemoScenariosScreen.jpg -------------------------------------------------------------------------------- /.attachments/ExecuteConfirm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/ExecuteConfirm.jpg -------------------------------------------------------------------------------- /.attachments/ExecutionComplete.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/ExecutionComplete.jpg -------------------------------------------------------------------------------- /.attachments/ImportConfirm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/ImportConfirm.jpg -------------------------------------------------------------------------------- /.attachments/LatestReleaseScreen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/LatestReleaseScreen.jpg -------------------------------------------------------------------------------- /.attachments/UnblockZipScreen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/UnblockZipScreen.jpg -------------------------------------------------------------------------------- /.attachments/nugetScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/nugetScreen.png -------------------------------------------------------------------------------- /.attachments/obfuscationDemoScenario.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/obfuscationDemoScenario.png -------------------------------------------------------------------------------- /.attachments/outputFilesExample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/outputFilesExample.png -------------------------------------------------------------------------------- /.attachments/solutionView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/.attachments/solutionView.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Provide code snippets which demonstrate the usage scenario to reproduce the behavior. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Additional context** 20 | Add any other context about the problem here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Please first discuss the change you wish to make via an issue before making a change. 4 | 5 | ## Pull request process 6 | 7 | 1. Ensure that there are automated tests that cover any changes 8 | 2. Update the README.md with details of any significant changes to functionality 9 | 3. Ensure that your commit messages increment the version using [GitVersion syntax](https://gitversion.readthedocs.io/en/latest/input/docs/more-info/version-increments/). If no message is found then the patch version will be incremented by default. 10 | 4. You may merge the pull request once it meets all of the required checks. If you do not have permision, a reviewer will do it for you 11 | -------------------------------------------------------------------------------- /GitVersion.yml: -------------------------------------------------------------------------------- 1 | mode: mainline 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Capgemini 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /azure-pipelines-pull-request.yml: -------------------------------------------------------------------------------- 1 | name: $(GitVersion.NuGetVersionV2) 2 | trigger: none 3 | pr: 4 | - master 5 | pool: 6 | vmImage: 'windows-latest' 7 | variables: 8 | solution: '**/*.sln' 9 | buildPlatform: 'any cpu' 10 | buildConfiguration: 'Release' 11 | stages: 12 | - stage: Build 13 | jobs: 14 | - template: templates/commonbuildtasks.yml 15 | -------------------------------------------------------------------------------- /samples/Capgemini.Xrm.DataMigration.Samples.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = 3 | build_property.TargetFramework = 4 | build_property.TargetFramework = 5 | build_property.TargetFramework = 6 | build_property.TargetFramework = 7 | build_property.TargetPlatformMinVersion = 8 | build_property.TargetPlatformMinVersion = 9 | build_property.TargetPlatformMinVersion = 10 | build_property.TargetPlatformMinVersion = 11 | build_property.TargetPlatformMinVersion = 12 | build_property.UsingMicrosoftNETSdkWeb = 13 | build_property.UsingMicrosoftNETSdkWeb = 14 | build_property.UsingMicrosoftNETSdkWeb = 15 | build_property.UsingMicrosoftNETSdkWeb = 16 | build_property.UsingMicrosoftNETSdkWeb = 17 | build_property.ProjectTypeGuids = 18 | build_property.ProjectTypeGuids = 19 | build_property.ProjectTypeGuids = 20 | build_property.ProjectTypeGuids = 21 | build_property.ProjectTypeGuids = 22 | build_property.PublishSingleFile = 23 | build_property.PublishSingleFile = 24 | build_property.PublishSingleFile = 25 | build_property.PublishSingleFile = 26 | build_property.PublishSingleFile = 27 | build_property.IncludeAllContentForSelfExtract = 28 | build_property.IncludeAllContentForSelfExtract = 29 | build_property.IncludeAllContentForSelfExtract = 30 | build_property.IncludeAllContentForSelfExtract = 31 | build_property.IncludeAllContentForSelfExtract = 32 | build_property._SupportedPlatformList = 33 | build_property._SupportedPlatformList = 34 | build_property._SupportedPlatformList = 35 | build_property._SupportedPlatformList = 36 | build_property._SupportedPlatformList = 37 | -------------------------------------------------------------------------------- /samples/ConsoleLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using Capgemini.DataMigration.Core; 4 | 5 | namespace Capgemini.Xrm.Datamigration.Examples 6 | { 7 | [ExcludeFromCodeCoverage] 8 | public class ConsoleLogger : ILogger 9 | { 10 | /// 11 | /// Gets or sets LogLevel - 0 - only Errors, 1 - Warnings, 2 - Info, 3 - Verbose. 12 | /// 13 | public static int LogLevel { get; set; } = 2; 14 | 15 | public void LogError(string message) 16 | { 17 | Console.WriteLine("Error:" + message); 18 | } 19 | 20 | public void LogError(string message, Exception ex) 21 | { 22 | Console.WriteLine($"Error: {message} ,Ex: {ex}"); 23 | } 24 | 25 | public void LogInfo(string message) 26 | { 27 | if (LogLevel > 1) 28 | { 29 | Console.WriteLine($"Info: {message}"); 30 | } 31 | } 32 | 33 | public void LogVerbose(string message) 34 | { 35 | if (LogLevel > 2) 36 | { 37 | Console.WriteLine($"Verbose: {message}"); 38 | } 39 | } 40 | 41 | public void LogWarning(string message) 42 | { 43 | if (LogLevel > 0) 44 | { 45 | Console.WriteLine($"Warning: {message}"); 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/BusinessUnits/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "CrmMigrationToolSchemaPaths": [ "GetAutomatically" ], 3 | "CrmMigrationToolSchemaFilters": {}, 4 | "PageSize": 1000, 5 | "BatchSize": 1000, 6 | "TopCount": 10000, 7 | "OnlyActiveRecords": false, 8 | "JsonFolderPath": "GetAutomatically", 9 | "OneEntityPerBatch": true, 10 | "FilePrefix": "bunits", 11 | "SeperateFilesPerEntity": true, 12 | "LookupMapping": { 13 | "businessunit": { 14 | "businessunitid": [ "name" ], 15 | "parentbusinessunitid": [ "name" ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/DemoScenarios/BusinessUnits/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "JsonFolderPath": "GetAutomatically", 3 | "IgnoreStatuses": true, 4 | "IgnoreSystemFields": true, 5 | "SaveBatchSize": 50, 6 | "DeactivateAllProcesses": false, 7 | "FilePrefix": "bunits", 8 | "PassOneReferences": [ 9 | "businessunit", 10 | "uom", 11 | "uomschedule", 12 | "queue" 13 | ], 14 | "MigrationConfig": { 15 | "ApplyAliasMapping": true, 16 | "SourceRootBUName": "RootBU" 17 | } 18 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/BusinessUnits/Schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/DemoScenarios/Calendars/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "CrmMigrationToolSchemaPaths": [ 3 | "GetAutomatically" 4 | ], 5 | "JsonFolderPath": "GetAutomatically", 6 | "PageSize": 500, 7 | "BatchSize": 1000, 8 | "TopCount": 10000, 9 | "OnlyActiveRecords": false, 10 | "OneEntityPerBatch": true, 11 | "FilePrefix": "Calendars", 12 | "SeperateFilesPerEntity": true, 13 | "CrmMigrationToolSchemaFilters": { 14 | "calendar": " 12 " 15 | }, 16 | "LookupMapping": { 17 | "calendar": { 18 | "businessunitid": [ 19 | "name" 20 | ] 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/Calendars/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "JsonFolderPath": "GetAutomatically", 3 | "IgnoreStatuses": true, 4 | "IgnoreSystemFields": true, 5 | "SaveBatchSize": 50, 6 | "DeactivateAllProcesses": false, 7 | "FilePrefix": "Calendars", 8 | "PassOneReferences": [ 9 | "businessunit", 10 | "uom", 11 | "uomschedule", 12 | "queue" 13 | ], 14 | "MigrationConfig": { 15 | "ApplyAliasMapping": true, 16 | "SourceRootBUName": "capgeminitest" 17 | } 18 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/Calendars/Schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/DemoScenarios/Contacts/Schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/DemoScenarios/CrmPortals/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "CrmMigrationToolSchemaPaths": [ 3 | "GetAutomatically" 4 | ], 5 | "JsonFolderPath": "GetAutomatically", 6 | "PageSize": 500, 7 | "BatchSize": 1000, 8 | "TopCount": 10000, 9 | "OnlyActiveRecords": false, 10 | "OneEntityPerBatch": true, 11 | "FilePrefix": "CrmPortals", 12 | "SeperateFilesPerEntity": true, 13 | "CrmMigrationToolSchemaFilters": { 14 | "adx_sitesetting": " " 15 | }, 16 | "LookupMapping": { 17 | } 18 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/CrmPortals/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "JsonFolderPath": "GetAutomatically", 3 | "IgnoreStatuses": true, 4 | "IgnoreSystemFields": true, 5 | "FiledsToIgnore": [ 6 | "createdby", 7 | "createdonbehalfby", 8 | "createdon", 9 | "importsequencenumber", 10 | "modifiedby", 11 | "modifiedonbehalfby", 12 | "modifiedon", 13 | "ownerid", 14 | "owningbusinessunit", 15 | "owningteam", 16 | "owninguser", 17 | "overriddencreatedon", 18 | "timezoneruleversionnumber", 19 | "utcconversiontimezonecode", 20 | "versionnumber", 21 | "transactioncurrencyid", 22 | "organizationid", 23 | "statecode", 24 | "statuscode" 25 | ], 26 | "SaveBatchSize": 50, 27 | "DeactivateAllProcesses": true, 28 | "FilePrefix": "CrmPortals", 29 | "PassOneReferences": [ 30 | "businessunit", 31 | "uom", 32 | "uomschedule", 33 | "queue" 34 | ], 35 | "MigrationConfig": { 36 | "ApplyAliasMapping": true, 37 | "SourceRootBUName": "capgeminitest" 38 | }, 39 | "EntitiesToSync": [ 40 | "adx_weblink", 41 | "adx_webpage", 42 | "adx_sitesetting" 43 | ] 44 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/DuplicateDetection/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "CrmMigrationToolSchemaPaths": [ 3 | "C:\\Users\\macunnin\\Source\\Repos\\xrm-datamigration\\Capgemini.Xrm.Datamigration\\Capgemini.Xrm.Datamigration.Examples\\bin\\Debug\\DemoScenarios\\DuplicateDetection\\Schema.xml" 4 | ], 5 | "CrmMigrationToolSchemaFilters": {}, 6 | "PageSize": 500, 7 | "BatchSize": 1000, 8 | "TopCount": 10000, 9 | "OnlyActiveRecords": false, 10 | "JsonFolderPath": "C:\\Users\\macunnin\\Source\\Repos\\xrm-datamigration\\Capgemini.Xrm.Datamigration\\Capgemini.Xrm.Datamigration.Examples\\bin\\Debug\\DemoScenarios\\DuplicateDetection\\ExportedData", 11 | "OneEntityPerBatch": true, 12 | "FilePrefix": "DemoDuplicateDetection", 13 | "SeperateFilesPerEntity": true, 14 | "LookupMapping": {} 15 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/DuplicateDetection/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "IgnoreStatuses": false, 3 | "IgnoreSystemFields": false, 4 | "SaveBatchSize": 50, 5 | "JsonFolderPath": "C:\\Users\\macunnin\\Source\\Repos\\xrm-datamigration\\Capgemini.Xrm.Datamigration\\Capgemini.Xrm.Datamigration.Examples\\bin\\Debug\\DemoScenarios\\DuplicateDetection\\ExportedData", 6 | "DeactivateAllProcesses": false, 7 | "FilePrefix": "DemoDuplicateDetection", 8 | "PassOneReferences": [ 9 | "businessunit", 10 | "uom", 11 | "uomschedule", 12 | "queue" 13 | ] 14 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/DuplicateDetection/schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/DemoScenarios/FieldServiceConfig/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "CrmMigrationToolSchemaPaths": [ "GetAutomatically" ], 3 | "CrmMigrationToolSchemaFilters": {}, 4 | "PageSize": 1000, 5 | "BatchSize": 1000, 6 | "TopCount": 10000, 7 | "OnlyActiveRecords": false, 8 | "JsonFolderPath": "GetAutomatically", 9 | "OneEntityPerBatch": true, 10 | "FilePrefix": "fieldservice", 11 | "SeperateFilesPerEntity": true, 12 | "LookupMapping": { 13 | "msdyn_incidenttypeservice": { 14 | "msdyn_unit": [ "name" ] 15 | }, 16 | "product": { 17 | "defaultuomid": [ "name" ], 18 | "defaultuomscheduleid": [ "name" ] 19 | }, 20 | "productpricelevel": { 21 | "uomid": [ "name" ], 22 | "uomscheduleid": [ "name" ] 23 | }, 24 | "uom": { 25 | "uomid": [ "name" ], 26 | "baseuom": [ "name" ], 27 | "uomscheduleid": [ "name" ] 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /samples/DemoScenarios/FieldServiceConfig/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "IgnoreStatuses": false, 3 | "IgnoreSystemFields": true, 4 | "MigrationConfig": { 5 | "ApplyAliasMapping": true, 6 | "SourceRootBUName": "test", 7 | "Mappings": {} 8 | }, 9 | "SaveBatchSize": 200, 10 | "JsonFolderPath": "GetAutomatically", 11 | "DeactivateAllProcesses": false, 12 | "FilePrefix": "fieldservice", 13 | "PassOneReferences": [ 14 | "uomschedule", 15 | "uom", 16 | "msdyn_service", 17 | "msdyn_incidenttype", 18 | "msdyn_tasktype" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /samples/DemoScenarios/ManyToMany/Schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/DemoScenarios/Obfuscation/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "IgnoreStatuses": false, 3 | "IgnoreStatusesExceptions": [], 4 | "IgnoreSystemFields": false, 5 | "AdditionalFieldsToIgnore": [], 6 | "SaveBatchSize": 50, 7 | "JsonFolderPath": "C:\\Users\\dpowell\\source\\repos\\GitHub\\Personal\\xrm-datamigration\\samples\\bin\\Debug\\DemoScenarios\\Obfuscation\\ExportedData", 8 | "EntitiesToSync": [], 9 | "NoUpsertEntities": [], 10 | "PluginsToDeactivate": [], 11 | "ProcessesToDeactivate": [], 12 | "DeactivateAllProcesses": false, 13 | "FilePrefix": "DemoObfuscation", 14 | "PassOneReferences": [ 15 | "businessunit", 16 | "uom", 17 | "uomschedule", 18 | "queue", 19 | "duplicaterule", 20 | "contact", 21 | "account", 22 | "organization" 23 | ], 24 | "NoUpdateEntities": [] 25 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/OneToMany/Schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/DemoScenarios/OrgSettings/Schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/DemoScenarios/OrganizationHierarchy/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "CrmMigrationToolSchemaPaths": [ 3 | "GetAutomatically" 4 | ], 5 | "JsonFolderPath": "GetAutomatically", 6 | "PageSize": 500, 7 | "BatchSize": 1000, 8 | "TopCount": 10000, 9 | "OnlyActiveRecords": false, 10 | "OneEntityPerBatch": true, 11 | "FilePrefix": "DemoOrganizationHierarchy", 12 | "SeperateFilesPerEntity": true, 13 | "CrmMigrationToolSchemaFilters": { 14 | "team": " ", 15 | "queue": " ", 16 | "businessunit": " " 17 | }, 18 | "LookupMapping": { 19 | "team": { 20 | "businessunitid": [ 21 | "name" 22 | ], 23 | "teamid": [ 24 | "name", 25 | "businessunitid" 26 | ] 27 | }, 28 | "queue": { 29 | "businessunitid": [ 30 | "name" 31 | ], 32 | "queueid": [ 33 | "name" 34 | ] 35 | }, 36 | "teamroles": { 37 | "roleid": [ 38 | "name", 39 | "businessunitid" 40 | ], 41 | "teamid": [ 42 | "name", 43 | "businessunitid" 44 | ] 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/OrganizationHierarchy/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "JsonFolderPath": "GetAutomatically", 3 | "IgnoreStatuses": true, 4 | "IgnoreSystemFields": true, 5 | "SaveBatchSize": 50, 6 | "DeactivateAllProcesses": false, 7 | "FilePrefix": "DemoOrganizationHierarchy", 8 | "PassOneReferences": [ 9 | "businessunit", 10 | "uom", 11 | "uomschedule", 12 | "queue" 13 | ], 14 | "MigrationConfig": { 15 | "ApplyAliasMapping": true, 16 | "SourceRootBUName": "capgeminitest" 17 | } 18 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/ServiceBusSettings/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "CrmMigrationToolSchemaPaths": [ 3 | "GetAutomatically" 4 | ], 5 | "JsonFolderPath": "GetAutomatically", 6 | "PageSize": 500, 7 | "BatchSize": 1000, 8 | "TopCount": 10000, 9 | "OnlyActiveRecords": false, 10 | "OneEntityPerBatch": true, 11 | "FilePrefix": "SubjectsAndArticles", 12 | "SeperateFilesPerEntity": true, 13 | "CrmMigrationToolSchemaFilters": {}, 14 | "LookupMapping": {} 15 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/ServiceBusSettings/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "JsonFolderPath": "GetAutomatically", 3 | "IgnoreStatuses": true, 4 | "IgnoreStatusesExceptions": [ 5 | "knowledgearticle" 6 | ], 7 | "IgnoreSystemFields": true, 8 | "SaveBatchSize": 50, 9 | "DeactivateAllProcesses": false, 10 | "FilePrefix": "SubjectsAndArticles", 11 | "PassOneReferences": [ 12 | "businessunit", 13 | "uom", 14 | "uomschedule", 15 | "queue" 16 | ], 17 | "MigrationConfig": { 18 | "ApplyAliasMapping": true, 19 | "SourceRootBUName": "test" 20 | } 21 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/ServiceBusSettings/Schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/DemoScenarios/SubjectsAndArticles/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "CrmMigrationToolSchemaPaths": [ 3 | "GetAutomatically" 4 | ], 5 | "JsonFolderPath": "GetAutomatically", 6 | "PageSize": 500, 7 | "BatchSize": 1000, 8 | "TopCount": 10000, 9 | "OnlyActiveRecords": false, 10 | "OneEntityPerBatch": true, 11 | "FilePrefix": "SubjectsAndArticles", 12 | "SeperateFilesPerEntity": true, 13 | "CrmMigrationToolSchemaFilters": { 14 | "subject": " ", 15 | "knowledgearticle": "" 16 | }, 17 | "LookupMapping": { 18 | "knowledgearticle": { 19 | "subjectid": [ 20 | "title" 21 | ] 22 | }, 23 | "subject": { 24 | "subjectid": [ 25 | "title" 26 | ], 27 | "parentsubject": [ 28 | "title" 29 | ] 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/SubjectsAndArticles/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "JsonFolderPath": "GetAutomatically", 3 | "IgnoreStatuses": true, 4 | "IgnoreStatusesExceptions": [ 5 | "knowledgearticle" 6 | ], 7 | "IgnoreSystemFields": true, 8 | "SaveBatchSize": 50, 9 | "DeactivateAllProcesses": false, 10 | "FilePrefix": "SubjectsAndArticles", 11 | "PassOneReferences": [ 12 | "businessunit", 13 | "uom", 14 | "uomschedule", 15 | "queue" 16 | ], 17 | "MigrationConfig": { 18 | "ApplyAliasMapping": true, 19 | "SourceRootBUName": "capgeminitest" 20 | } 21 | } -------------------------------------------------------------------------------- /samples/DemoScenarios/UsersAndRoles/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "CrmMigrationToolSchemaPaths": [ 3 | "GetAutomatically" 4 | ], 5 | "CrmMigrationToolSchemaFilters": { 6 | "systemuser": "", 7 | "systemuserroles": "" 8 | }, 9 | "PageSize": 1000, 10 | "BatchSize": 1000, 11 | "TopCount": 10000, 12 | "OnlyActiveRecords": false, 13 | "JsonFolderPath": "GetAutomatically", 14 | "OneEntityPerBatch": true, 15 | "FilePrefix": "ExportedData", 16 | "SeperateFilesPerEntity": true, 17 | "LookupMapping": { 18 | "systemuser": { 19 | "systemuserid": [ 20 | "domainname" 21 | ], 22 | "businessunitid": [ 23 | "name" 24 | ] 25 | }, 26 | "systemuserroles": { 27 | "systemuserid": [ 28 | "domainname" 29 | ], 30 | "roleid": [ 31 | "name", 32 | "businessunitid" 33 | ] 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /samples/DemoScenarios/UsersAndRoles/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "IgnoreStatuses": true, 3 | "IgnoreSystemFields": true, 4 | "MigrationConfig": { 5 | "ApplyAliasMapping": true, 6 | "SourceRootBUName": "mainbu", 7 | "Mappings": {} 8 | }, 9 | "SaveBatchSize": 200, 10 | "JsonFolderPath": "GetAutomatically", 11 | "DeactivateAllProcesses": false, 12 | "FilePrefix": "ExportedData", 13 | "PassOneReferences": [ 14 | "businessunit", 15 | "uom", 16 | "uomschedule", 17 | "queue" 18 | ] 19 | } -------------------------------------------------------------------------------- /samples/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Capgemini.Xrm.Datamigration.Examples")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Capgemini.Xrm.Datamigration.Examples")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2f210350-b2b6-4955-ad3f-f115658cb150")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /samples/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | False 7 | 8 | 9 | Contacts 10 | 11 | 12 | AuthType=OAuth; Username=name[at]example.onmicrosoft.com; Password=**********; Url=https://contosotest.crm.dynamics.com; AppId=51f81489-12ee-4a9e-aaae-a2591f45987d; RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97; LoginPrompt=Auto; RequireNewInstance=True; 13 | 14 | 15 | AuthType=OAuth; Username=name[at]example.onmicrosoft.com; Password=**********; Url=https://contosotest.crm.dynamics.com; AppId=51f81489-12ee-4a9e-aaae-a2591f45987d; RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97; LoginPrompt=Auto; RequireNewInstance=True; 16 | 17 | 18 | 1 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Attributes/ValidatedNotNullAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Capgemini.DataMigration.Core.Attributes 4 | { 5 | [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] 6 | public sealed class ValidatedNotNullAttribute : Attribute 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Cache/SimpleMemoryCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Caching; 3 | 4 | namespace Capgemini.DataMigration.Cache 5 | { 6 | public abstract class SimpleMemoryCache 7 | { 8 | protected int ExpirationMinutes { get; set; } = 60; 9 | 10 | protected abstract TItem CreateCachedItem(string cacheKey); 11 | 12 | protected TItem GetCachedItem(string cacheKey) 13 | { 14 | var cachedObject = MemoryCache.Default.Get(cacheKey, null); 15 | 16 | if (cachedObject != null) 17 | { 18 | return (TItem)cachedObject; 19 | } 20 | 21 | // If not in cache, then needs to be populated 22 | lock (MemoryCache.Default) 23 | { 24 | // Check to see if anyone wrote to the cache in the meantime 25 | cachedObject = MemoryCache.Default.Get(cacheKey, null); 26 | 27 | if (cachedObject != null) 28 | { 29 | return (TItem)cachedObject; 30 | } 31 | 32 | TItem newIstance = CreateCachedItem(cacheKey); 33 | 34 | CacheItemPolicy cip = new CacheItemPolicy 35 | { 36 | AbsoluteExpiration = new DateTimeOffset(DateTime.Now.AddMinutes(ExpirationMinutes)) 37 | }; 38 | 39 | MemoryCache.Default.Set(cacheKey, newIstance, cip); 40 | 41 | return newIstance; 42 | } 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Capgemini.DataMigration.Core.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = 3 | build_property.TargetFramework = 4 | build_property.TargetFramework = 5 | build_property.TargetFramework = 6 | build_property.TargetFramework = 7 | build_property.TargetPlatformMinVersion = 8 | build_property.TargetPlatformMinVersion = 9 | build_property.TargetPlatformMinVersion = 10 | build_property.TargetPlatformMinVersion = 11 | build_property.TargetPlatformMinVersion = 12 | build_property.UsingMicrosoftNETSdkWeb = 13 | build_property.UsingMicrosoftNETSdkWeb = 14 | build_property.UsingMicrosoftNETSdkWeb = 15 | build_property.UsingMicrosoftNETSdkWeb = 16 | build_property.UsingMicrosoftNETSdkWeb = 17 | build_property.ProjectTypeGuids = 18 | build_property.ProjectTypeGuids = 19 | build_property.ProjectTypeGuids = 20 | build_property.ProjectTypeGuids = 21 | build_property.ProjectTypeGuids = 22 | build_property.PublishSingleFile = 23 | build_property.PublishSingleFile = 24 | build_property.PublishSingleFile = 25 | build_property.PublishSingleFile = 26 | build_property.PublishSingleFile = 27 | build_property.IncludeAllContentForSelfExtract = 28 | build_property.IncludeAllContentForSelfExtract = 29 | build_property.IncludeAllContentForSelfExtract = 30 | build_property.IncludeAllContentForSelfExtract = 31 | build_property.IncludeAllContentForSelfExtract = 32 | build_property._SupportedPlatformList = 33 | build_property._SupportedPlatformList = 34 | build_property._SupportedPlatformList = 35 | build_property._SupportedPlatformList = 36 | build_property._SupportedPlatformList = 37 | -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Capgemini.DataMigration.Core.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/ConsoleLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | 4 | namespace Capgemini.DataMigration.Core 5 | { 6 | public class ConsoleLogger : ILogger 7 | { 8 | /// 9 | /// Gets or sets logLevel 10 | /// 0 - only Errors 11 | /// 1 - Warnings 12 | /// 2 - Info 13 | /// 3 - Verbose. 14 | /// 15 | public static int LogLevel { get; set; } = 2; 16 | 17 | public void LogError(string message) 18 | { 19 | Trace.WriteLine($"Error:{message}"); 20 | } 21 | 22 | public void LogError(string message, Exception ex) 23 | { 24 | Trace.WriteLine($"Error:{message},Ex:{ex?.ToString()}"); 25 | } 26 | 27 | public void LogInfo(string message) 28 | { 29 | if (LogLevel > 1) 30 | { 31 | Trace.WriteLine($"Info:{message}"); 32 | } 33 | } 34 | 35 | public void LogVerbose(string message) 36 | { 37 | if (LogLevel > 2) 38 | { 39 | Trace.WriteLine($"Verbose:{message}"); 40 | } 41 | } 42 | 43 | public void LogWarning(string message) 44 | { 45 | if (LogLevel > 0) 46 | { 47 | Trace.WriteLine($"Warning:{message}"); 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/DataStore/MigrationEntityWrapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Capgemini.DataMigration.Core; 3 | 4 | namespace Capgemini.DataMigration.DataStore 5 | { 6 | public abstract class MigrationEntityWrapper 7 | where TMigrationEntity : class 8 | { 9 | protected MigrationEntityWrapper(TMigrationEntity entity, bool isManyToMany = false) 10 | { 11 | OriginalEntity = entity; 12 | OperationType = OperationType.New; 13 | IsManyToMany = isManyToMany; 14 | } 15 | 16 | public OperationType OperationType { get; set; } 17 | 18 | public TMigrationEntity OriginalEntity { get; private set; } 19 | 20 | public string OperationResult { get; set; } 21 | 22 | public int? OperationErrorCode { get; set; } 23 | 24 | public bool IsManyToMany { get; internal set; } 25 | 26 | public abstract Guid Id { get; } 27 | 28 | public abstract string LogicalName { get; } 29 | 30 | public abstract int AttributesCount { get; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Exceptions/ConfigurationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace Capgemini.DataMigration.Exceptions 5 | { 6 | [Serializable] 7 | public class ConfigurationException : Exception 8 | { 9 | public ConfigurationException() 10 | { 11 | } 12 | 13 | public ConfigurationException(string message) 14 | : base(message) 15 | { 16 | } 17 | 18 | public ConfigurationException(string message, Exception inner) 19 | : base(message, inner) 20 | { 21 | } 22 | 23 | protected ConfigurationException(SerializationInfo info, StreamingContext context) 24 | : base(info, context) 25 | { 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Exceptions/ValidationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace Capgemini.DataMigration.Exceptions 5 | { 6 | [Serializable] 7 | public class ValidationException : Exception 8 | { 9 | public ValidationException() 10 | { 11 | } 12 | 13 | public ValidationException(string message) 14 | : base(message) 15 | { 16 | } 17 | 18 | public ValidationException(string message, Exception inner) 19 | : base(message, inner) 20 | { 21 | } 22 | 23 | protected ValidationException(SerializationInfo info, StreamingContext context) 24 | : base(info, context) 25 | { 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Extensions/ExceptionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Capgemini.DataMigration.Core.Attributes; 3 | 4 | namespace Capgemini.DataMigration.Core.Extensions 5 | { 6 | public static class ExceptionExtensions 7 | { 8 | public static void ThrowArgumentNullExceptionIfNull([ValidatedNotNull] this object input, string argumentName, string message = "input parameter should not be null!") 9 | { 10 | if (input == null) 11 | { 12 | throw new ArgumentNullException(argumentName, message); 13 | } 14 | } 15 | 16 | public static void ThrowIfNull([ValidatedNotNull] this object input, string message) 17 | where T : Exception 18 | { 19 | if (input == null) 20 | { 21 | throw Activator.CreateInstance(typeof(T), message) as T; 22 | } 23 | } 24 | 25 | public static void ThrowArgumentOutOfRangeExceptionIfTrue(this bool input, string argumentName, string message = "") 26 | { 27 | if (input) 28 | { 29 | throw new ArgumentOutOfRangeException(argumentName, message); 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/IDataStoreReader.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Capgemini.DataMigration.DataStore; 3 | 4 | namespace Capgemini.DataMigration.Core 5 | { 6 | public interface IDataStoreReader 7 | where TMigrationEntity : class 8 | where TMigrationEntityWrapper : MigrationEntityWrapper 9 | { 10 | List ReadBatchDataFromStore(); 11 | 12 | void Reset(); 13 | } 14 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/IDataStoreWriter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Capgemini.DataMigration.DataStore; 3 | 4 | namespace Capgemini.DataMigration.Core 5 | { 6 | public interface IDataStoreWriter 7 | where TMigrationEntity : class 8 | where TMigrationEntityWrapper : MigrationEntityWrapper 9 | { 10 | void SaveBatchDataToStore(List entities); 11 | 12 | void Reset(); 13 | } 14 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/IEntityProcessor.cs: -------------------------------------------------------------------------------- 1 | using Capgemini.DataMigration.DataStore; 2 | 3 | namespace Capgemini.DataMigration.Core 4 | { 5 | /// 6 | /// Data Processor Interface. 7 | /// 8 | /// TMigrationEntity. 9 | /// TMigrationEntityWrapper. 10 | public interface IEntityProcessor 11 | where TMigrationEntity : class 12 | where TMigrationEntityWrapper : MigrationEntityWrapper 13 | { 14 | /// 15 | /// Gets minimum number of passes through data required by the processor. 16 | /// 17 | int MinRequiredPassNumber { get; } 18 | 19 | /// 20 | /// Process Entity. 21 | /// 22 | /// Entity to process. 23 | /// Pass Number. 24 | /// maxPassNumber. 25 | void ProcessEntity(TMigrationEntityWrapper entity, int passNumber, int maxPassNumber); 26 | 27 | /// 28 | /// Called by engine when import is being initialized. 29 | /// 30 | void ImportStarted(); 31 | 32 | /// 33 | /// Called by engine when import is completed. 34 | /// 35 | void ImportCompleted(); 36 | } 37 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/IGenericDataMigrator.cs: -------------------------------------------------------------------------------- 1 | using Capgemini.DataMigration.DataStore; 2 | 3 | namespace Capgemini.DataMigration.Core 4 | { 5 | public interface IGenericDataMigrator 6 | where TMigrationEntity : class 7 | where TMigrationEntityWrapper : MigrationEntityWrapper 8 | { 9 | void AddProcessor(IEntityProcessor processor); 10 | 11 | int GetStartingPassNumber(); 12 | 13 | void MigrateData(); 14 | } 15 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/ILogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Capgemini.DataMigration.Core 4 | { 5 | /// 6 | /// Logging interface. 7 | /// 8 | public interface ILogger 9 | { 10 | void LogError(string message); 11 | 12 | void LogError(string message, Exception ex); 13 | 14 | void LogInfo(string message); 15 | 16 | void LogVerbose(string message); 17 | 18 | void LogWarning(string message); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Model/EntityToBeObfuscated.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Capgemini.DataMigration.Core.Model 4 | { 5 | /// 6 | /// Stores details of an Entity that contains fields that will be obfuscated. 7 | /// 8 | public class EntityToBeObfuscated 9 | { 10 | /// 11 | /// Gets or Sets the name of the Entity. 12 | /// 13 | public string EntityName { get; set; } 14 | 15 | /// 16 | /// Gets the fields that will be obfuscated. 17 | /// 18 | public List FieldsToBeObfuscated { get; private set; } = new List(); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Model/FieldToBeObfuscated.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Newtonsoft.Json; 4 | 5 | namespace Capgemini.DataMigration.Core.Model 6 | { 7 | /// 8 | /// Contains details of the field to be obfuscated. 9 | /// 10 | public class FieldToBeObfuscated 11 | { 12 | /// 13 | /// Gets or Sets the field name. 14 | /// 15 | public string FieldName { get; set; } 16 | 17 | /// 18 | /// Gets or Sets the formatting to be used when obfuscating the data. 19 | /// 20 | public string ObfuscationFormat { get; set; } 21 | 22 | /// 23 | /// Gets the function that will be used to generate the obfuscated values. 24 | /// 25 | public List ObfuscationFormatArgs { get; private set; } = new List(); 26 | 27 | [JsonIgnore] 28 | public bool CanBeFormatted 29 | { 30 | get 31 | { 32 | if (!string.IsNullOrWhiteSpace(this.ObfuscationFormat) && this.ObfuscationFormatArgs.Any()) 33 | { 34 | return true; 35 | } 36 | 37 | return false; 38 | } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Model/ObfuscationFormatOption.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Capgemini.DataMigration.Core.Model 4 | { 5 | public class ObfuscationFormatOption 6 | { 7 | public ObfuscationFormatOption(ObfuscationFormatType formatType, Dictionary arguments) 8 | { 9 | FormatType = formatType; 10 | Arguments = arguments; 11 | } 12 | 13 | /// 14 | /// Gets the type of formatting to be used when obfuscating. 15 | /// 16 | public ObfuscationFormatType FormatType { get; } 17 | 18 | /// 19 | /// Gets the arguments that will be used when data is being obfuscated. 20 | /// 21 | public Dictionary Arguments { get; } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Model/ObfuscationFormatType.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace Capgemini.DataMigration.Core.Model 5 | { 6 | /// 7 | /// The formatting type used by a format option. 8 | /// 9 | [JsonConverter(typeof(StringEnumConverter))] 10 | public enum ObfuscationFormatType 11 | { 12 | /// 13 | /// Generates a random string value 14 | /// 15 | RandomString, 16 | 17 | /// 18 | /// Generates a random number. 19 | /// 20 | RandomNumber, 21 | 22 | /// 23 | /// Looks up the data from an external source. 24 | /// 25 | Lookup 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Model/ObfuscationLookup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Dynamic; 4 | 5 | namespace Capgemini.DataMigration.Core.Model 6 | { 7 | public class ObfuscationLookup 8 | { 9 | private readonly List dataRows = new List(); 10 | 11 | public ObfuscationLookup(string name, List dataRows) 12 | { 13 | if (string.IsNullOrWhiteSpace(name)) 14 | { 15 | throw new ArgumentException($"{nameof(name)} must not be null or empty."); 16 | } 17 | 18 | if (dataRows == null || dataRows.Count.Equals(0)) 19 | { 20 | throw new ArgumentException($"{nameof(dataRows)} must not be null or empty."); 21 | } 22 | 23 | Name = name; 24 | this.dataRows = dataRows; 25 | } 26 | 27 | public int Count 28 | { 29 | get { return dataRows.Count; } 30 | } 31 | 32 | public string Name { get; } 33 | 34 | public object this[int index, string columnname] 35 | { 36 | get 37 | { 38 | ExpandoObject row = dataRows[index]; 39 | var properties = (IDictionary)row; 40 | 41 | if (properties.ContainsKey(columnname)) 42 | { 43 | return properties[columnname]; 44 | } 45 | 46 | return null; 47 | } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/OperationType.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.DataMigration.Core 2 | { 3 | /// 4 | /// Operation Types for migration engine. 5 | /// 6 | public enum OperationType 7 | { 8 | Create, 9 | Update, 10 | Associate, 11 | Assign, 12 | Failed, 13 | Ignore, 14 | New 15 | } 16 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Capgemini.DataMigration.Core")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Capgemini")] 11 | [assembly: AssemblyProduct("Capgemini.DataMigration.Core")] 12 | [assembly: AssemblyCopyright("Copyright © Capgemini Corporation 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("c8b84af3-31dd-44ae-80cd-13ab60549f7c")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.0.0.0")] 35 | [assembly: AssemblyFileVersion("2.0.0.0")] -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Resiliency/IPolicyBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Capgemini.DataMigration.Resiliency 4 | { 5 | /// 6 | /// A Fluent way to generate a retry Policy Builder. 7 | /// 8 | public interface IPolicyBuilder 9 | { 10 | /// 11 | /// Initialises the fluent policy builder. 12 | /// 13 | /// T. 14 | /// return. 15 | TType AddType() 16 | where T : Exception; 17 | 18 | /// 19 | /// Adds n number of Exception types allowing you to chain and build a complex command. 20 | /// 21 | /// T. 22 | /// return. 23 | TType AddOrType() 24 | where T : Exception; 25 | 26 | /// 27 | /// Executes an anaoymous function and returns a value. 28 | /// 29 | /// TResult. 30 | /// action. 31 | /// retries. 32 | /// return. 33 | TResult Execute(Func action, int retries); 34 | } 35 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/Resiliency/IRetryExecutor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Capgemini.DataMigration.Resiliency 4 | { 5 | /// 6 | /// Responsible for Configuring and Executing the retry. 7 | /// 8 | public interface IRetryExecutor 9 | { 10 | T Execute(Func p); 11 | } 12 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Core/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Resiliency.Polly/Capgemini.DataMigration.Resiliency.Polly.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Resiliency.Polly/GlobalSuppressions1.cs: -------------------------------------------------------------------------------- 1 | // This file is used by Code Analysis to maintain SuppressMessage 2 | // attributes that are applied to this project. 3 | // Project-level suppressions either have no target or are given 4 | // a specific target and scoped to a namespace, type, member, etc. 5 | 6 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "This operation should handle all exceptions thrown during the retry process.", Scope = "member", Target = "~M:Capgemini.DataMigration.Resiliency.Polly.PollyFluentPolicy.Execute``1(System.Func{``0},System.Int32)~``0")] -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Resiliency.Polly/PollyFluentPolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Polly; 3 | 4 | namespace Capgemini.DataMigration.Resiliency.Polly 5 | { 6 | public class PollyFluentPolicy : IPolicyBuilder 7 | { 8 | private PolicyBuilder p; 9 | 10 | public PollyFluentPolicy AddType() 11 | where T : Exception 12 | { 13 | p = Policy.Handle(); 14 | return this; 15 | } 16 | 17 | public PollyFluentPolicy AddOrType() 18 | where T : Exception 19 | { 20 | p = p.Or(); 21 | return this; 22 | } 23 | 24 | public virtual TResult Execute(Func action, int retries) 25 | { 26 | try 27 | { 28 | var res = p.Retry(retries).Execute(action); 29 | return res; 30 | } 31 | catch (Exception) 32 | { 33 | return default(TResult); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Resiliency.Polly/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Capgemini.DataMigration.Resiliency.Polly")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Capgemini")] 11 | [assembly: AssemblyProduct("Capgemini.DataMigration.Resiliency.Polly")] 12 | [assembly: AssemblyCopyright("Copyright © Capgemini Corporation 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("d2afccc9-6459-41ec-8c0e-9eee45fff507")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.0.0.0")] 35 | [assembly: AssemblyFileVersion("2.0.0.0")] -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Resiliency.Polly/ServiceRetryExecutor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ServiceModel; 3 | 4 | namespace Capgemini.DataMigration.Resiliency.Polly 5 | { 6 | /// 7 | /// A Facade wrapper around the executor. 8 | /// 9 | public class ServiceRetryExecutor : IRetryExecutor 10 | { 11 | private readonly IPolicyBuilder builder; 12 | 13 | public ServiceRetryExecutor() 14 | : this(new PollyFluentPolicy()) 15 | { 16 | } 17 | 18 | public ServiceRetryExecutor(IPolicyBuilder builder) 19 | { 20 | this.builder = builder; 21 | } 22 | 23 | public T Execute(Func p) 24 | { 25 | return builder 26 | .AddType() 27 | .AddOrType().Execute(p, 5); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Resiliency.Polly/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Capgemini.DataMigration.Resiliency.Polly/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Capgemini.DataScrambler.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = 3 | build_property.TargetFramework = 4 | build_property.TargetFramework = 5 | build_property.TargetFramework = 6 | build_property.TargetFramework = 7 | build_property.TargetPlatformMinVersion = 8 | build_property.TargetPlatformMinVersion = 9 | build_property.TargetPlatformMinVersion = 10 | build_property.TargetPlatformMinVersion = 11 | build_property.TargetPlatformMinVersion = 12 | build_property.UsingMicrosoftNETSdkWeb = 13 | build_property.UsingMicrosoftNETSdkWeb = 14 | build_property.UsingMicrosoftNETSdkWeb = 15 | build_property.UsingMicrosoftNETSdkWeb = 16 | build_property.UsingMicrosoftNETSdkWeb = 17 | build_property.ProjectTypeGuids = 18 | build_property.ProjectTypeGuids = 19 | build_property.ProjectTypeGuids = 20 | build_property.ProjectTypeGuids = 21 | build_property.ProjectTypeGuids = 22 | build_property.PublishSingleFile = 23 | build_property.PublishSingleFile = 24 | build_property.PublishSingleFile = 25 | build_property.PublishSingleFile = 26 | build_property.PublishSingleFile = 27 | build_property.IncludeAllContentForSelfExtract = 28 | build_property.IncludeAllContentForSelfExtract = 29 | build_property.IncludeAllContentForSelfExtract = 30 | build_property.IncludeAllContentForSelfExtract = 31 | build_property.IncludeAllContentForSelfExtract = 32 | build_property._SupportedPlatformList = 33 | build_property._SupportedPlatformList = 34 | build_property._SupportedPlatformList = 35 | build_property._SupportedPlatformList = 36 | build_property._SupportedPlatformList = 37 | -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Factories/ScramblerClientFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Capgemini.DataScrambler.Scramblers; 3 | 4 | namespace Capgemini.DataScrambler.Factories 5 | { 6 | public static class ScramblerClientFactory 7 | { 8 | public static ScramblerClient GetScrambler() 9 | { 10 | Type type = typeof(T); 11 | if (type == typeof(int)) 12 | { 13 | return new ScramblerClient((IScrambler)new IntegerScrambler()); 14 | } 15 | else if (type == typeof(string)) 16 | { 17 | return new ScramblerClient((IScrambler)new StringScrambler()); 18 | } 19 | else if (type == typeof(Guid)) 20 | { 21 | return new ScramblerClient((IScrambler)new GuidScrambler()); 22 | } 23 | else if (type == typeof(double)) 24 | { 25 | return new ScramblerClient((IScrambler)new DoubleScrambler()); 26 | } 27 | else if (type == typeof(decimal)) 28 | { 29 | return new ScramblerClient((IScrambler)new DecimalScrambler()); 30 | } 31 | else 32 | { 33 | throw new NotSupportedException($"The specified generic type {type.Name} could not be found"); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/GlobalSuppressions1.cs: -------------------------------------------------------------------------------- 1 | // This file is used by Code Analysis to maintain SuppressMessage 2 | // attributes that are applied to this project. 3 | // Project-level suppressions either have no target or are given 4 | // a specific target and scoped to a namespace, type, member, etc. 5 | 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | [assembly: SuppressMessage("Security", "SCS0005:Weak random generator", Justification = "The degree of randomness provided by the out of box random number generator is sufficient for the current solution", Scope = "member", Target = "~M:Capgemini.DataScrambler.Scramblers.DoubleScrambler.CalculateRandomDouble(System.Int32)~System.Double")] 9 | [assembly: SuppressMessage("Security", "SCS0005:Weak random generator", Justification = "The degree of randomness provided by the out of box random number generator is sufficient for the current solution", Scope = "member", Target = "~M:Capgemini.DataScrambler.Scramblers.IntegerScrambler.Scramble(System.Int32,System.Int32,System.Int32)~System.Int32")] 10 | [assembly: SuppressMessage("Security", "SCS0005:Weak random generator", Justification = "The degree of randomness provided by the out of box random number generator is sufficient for the current solution", Scope = "member", Target = "~M:Capgemini.DataScrambler.Scramblers.StringScrambler.ScrambleString(System.String,System.Int32,System.Int32)~System.String")] -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Capgemini.DataScrambler")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Capgemini.DataScrambler")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("00413b74-0224-4d49-a5c5-16ae29294537")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.2")] 36 | [assembly: AssemblyFileVersion("1.0.0.2")] 37 | -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/ScramblerClient.cs: -------------------------------------------------------------------------------- 1 | using Capgemini.DataScrambler.Scramblers; 2 | 3 | namespace Capgemini.DataScrambler 4 | { 5 | public class ScramblerClient 6 | { 7 | private IScrambler currentScrambler; 8 | 9 | public ScramblerClient(IScrambler scrambler) 10 | { 11 | currentScrambler = scrambler; 12 | } 13 | 14 | public T ExecuteScramble(T input, int min = 0, int max = 10) 15 | { 16 | return currentScrambler.Scramble(input, min, max); 17 | } 18 | 19 | public void ChangeScrambler(IScrambler newScrambler) 20 | { 21 | currentScrambler = newScrambler; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Scramblers/DecimalScrambler.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.DataScrambler.Scramblers 2 | { 3 | public class DecimalScrambler : IScrambler 4 | { 5 | private readonly DoubleScrambler doubleScrambler; 6 | 7 | public DecimalScrambler() 8 | { 9 | doubleScrambler = new DoubleScrambler(); 10 | } 11 | 12 | public decimal Scramble(decimal input, int min, int max) 13 | { 14 | double inputAsDouble = (double)input; 15 | return (decimal)doubleScrambler.Scramble(inputAsDouble, min, max); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Scramblers/DoubleScrambler.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.DataScrambler.Scramblers 2 | { 3 | public class DoubleScrambler : IScrambler 4 | { 5 | public DoubleScrambler() 6 | { 7 | } 8 | 9 | public double Scramble(double input, int min, int max) 10 | { 11 | double randomNumber = CalculateRandomDouble(max); 12 | while (randomNumber == input && randomNumber < min) 13 | { 14 | randomNumber = CalculateRandomDouble(max); 15 | } 16 | 17 | return randomNumber; 18 | } 19 | 20 | private static double CalculateRandomDouble(int max) => RandomGenerator.NextDouble() * max; 21 | } 22 | } -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Scramblers/EmailScambler.cs: -------------------------------------------------------------------------------- 1 | using Capgemini.DataMigration.Core.Extensions; 2 | using Capgemini.DataMigration.Exceptions; 3 | 4 | namespace Capgemini.DataScrambler.Scramblers 5 | { 6 | public class EmailScambler : StringScrambler 7 | { 8 | public EmailScambler() 9 | : base() 10 | { 11 | } 12 | 13 | public override string Scramble(string input, int min, int max) 14 | { 15 | input.ThrowArgumentNullExceptionIfNull(nameof(input)); 16 | 17 | string[] partsOfEmail = input.Split('@'); 18 | ValidateEmail(partsOfEmail); 19 | 20 | partsOfEmail[0] = ScrambleString(partsOfEmail[0], min, max); 21 | partsOfEmail[1] = ScrambleString(partsOfEmail[1], min, max); 22 | return string.Join("@", partsOfEmail); 23 | } 24 | 25 | private static void ValidateEmail(string[] partsOfEmail) 26 | { 27 | if (partsOfEmail.Length != 2) 28 | { 29 | throw new ValidationException("EmailScambler: This is not a valid email"); 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Scramblers/GuidScrambler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Capgemini.DataScrambler.Scramblers 4 | { 5 | public class GuidScrambler : IScrambler 6 | { 7 | public Guid Scramble(Guid input, int min, int max) 8 | { 9 | Guid output = Guid.NewGuid(); 10 | if (input.Equals(output)) 11 | { 12 | output = Scramble(input, min, max); 13 | } 14 | 15 | return output; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Scramblers/IScrambler.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.DataScrambler.Scramblers 2 | { 3 | public interface IScrambler 4 | { 5 | T Scramble(T input, int min, int max); 6 | } 7 | } -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Scramblers/IntegerScrambler.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.DataScrambler.Scramblers 2 | { 3 | public class IntegerScrambler : IScrambler 4 | { 5 | public IntegerScrambler() 6 | { 7 | } 8 | 9 | public int Scramble(int input, int min, int max) 10 | { 11 | int randomNumber = RandomGenerator.Next(min, max); 12 | 13 | while (randomNumber == input) 14 | { 15 | randomNumber = RandomGenerator.Next(min, max); 16 | } 17 | 18 | return randomNumber; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Scramblers/RandomGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | using System.Security.Cryptography; 4 | 5 | [assembly: InternalsVisibleTo("Capgemini.Xrm.DataMigration.Engine")] 6 | 7 | namespace Capgemini.DataScrambler.Scramblers 8 | { 9 | internal static class RandomGenerator 10 | { 11 | private static RandomNumberGenerator GetRandom { get; } = RandomNumberGenerator.Create(); 12 | 13 | internal static double NextDouble() 14 | { 15 | var bytes = new byte[sizeof(ulong)]; 16 | GetRandom.GetBytes(bytes); 17 | ulong nextULong = BitConverter.ToUInt64(bytes, 0); 18 | 19 | return (nextULong >> 11) * (1.0 / (1ul << 53)); 20 | } 21 | 22 | internal static int Next(int minValue, int maxValue) 23 | { 24 | if (minValue == maxValue) 25 | { 26 | return minValue; 27 | } 28 | 29 | if (minValue > maxValue) 30 | { 31 | throw new ArgumentOutOfRangeException(nameof(minValue), $"{nameof(minValue)} must be lower than {nameof(maxValue)}"); 32 | } 33 | 34 | var diff = (long)maxValue - minValue; 35 | 36 | return (int)(minValue + (diff * NextDouble())); 37 | } 38 | 39 | internal static int Next(int maxValue) 40 | { 41 | return Next(0, maxValue); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/Scramblers/StringScrambler.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | using Capgemini.DataMigration.Core.Extensions; 3 | 4 | namespace Capgemini.DataScrambler.Scramblers 5 | { 6 | public class StringScrambler : IScrambler 7 | { 8 | private const string Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 9 | 10 | public virtual string Scramble(string input, int min, int max) 11 | { 12 | return ScrambleString(input, min, max); 13 | } 14 | 15 | protected string ScrambleString(string input, int min, int max) 16 | { 17 | input.ThrowArgumentNullExceptionIfNull(nameof(input)); 18 | 19 | StringBuilder sb = new StringBuilder(); 20 | foreach (char c in input) 21 | { 22 | int randomNumber = RandomGenerator.Next(0, Chars.Length); 23 | char newCharacter = Chars[randomNumber]; 24 | sb.Append(newCharacter); 25 | } 26 | 27 | string outputString = sb.ToString(); 28 | if (input == outputString) 29 | { 30 | outputString = Scramble(input, min, max); 31 | } 32 | 33 | return outputString; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Capgemini.DataScrambler/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Cli/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Cli/Capgemini.Xrm.DataMigration.Cli.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = 3 | build_property.TargetFramework = 4 | build_property.TargetFramework = 5 | build_property.TargetFramework = 6 | build_property.TargetFramework = 7 | build_property.TargetPlatformMinVersion = 8 | build_property.TargetPlatformMinVersion = 9 | build_property.TargetPlatformMinVersion = 10 | build_property.TargetPlatformMinVersion = 11 | build_property.TargetPlatformMinVersion = 12 | build_property.UsingMicrosoftNETSdkWeb = 13 | build_property.UsingMicrosoftNETSdkWeb = 14 | build_property.UsingMicrosoftNETSdkWeb = 15 | build_property.UsingMicrosoftNETSdkWeb = 16 | build_property.UsingMicrosoftNETSdkWeb = 17 | build_property.ProjectTypeGuids = 18 | build_property.ProjectTypeGuids = 19 | build_property.ProjectTypeGuids = 20 | build_property.ProjectTypeGuids = 21 | build_property.ProjectTypeGuids = 22 | build_property.PublishSingleFile = 23 | build_property.PublishSingleFile = 24 | build_property.PublishSingleFile = 25 | build_property.PublishSingleFile = 26 | build_property.PublishSingleFile = 27 | build_property.IncludeAllContentForSelfExtract = 28 | build_property.IncludeAllContentForSelfExtract = 29 | build_property.IncludeAllContentForSelfExtract = 30 | build_property.IncludeAllContentForSelfExtract = 31 | build_property.IncludeAllContentForSelfExtract = 32 | build_property._SupportedPlatformList = 33 | build_property._SupportedPlatformList = 34 | build_property._SupportedPlatformList = 35 | build_property._SupportedPlatformList = 36 | build_property._SupportedPlatformList = 37 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Cli/Capgemini.Xrm.DataMigration.Cli.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Capgemini.Xrm.DataMigration.Cli 5 | 2.0.0.8 6 | Capgemini Xrm DataMigration Engine - CLI 7 | Capgemini 8 | Capgemini 9 | false 10 | Command-line interface for the Capgemini Data Migration Engine 11 | Copyright 2018 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Cli/Capgemini.Xrm.DataMigration.Cli.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Cli/ExportOptions.cs: -------------------------------------------------------------------------------- 1 | using CommandLine; 2 | 3 | namespace Capgemini.Xrm.DataMigration.Cli 4 | { 5 | [Verb("export", HelpText = "Export data from a Dynamics 365 instance.")] 6 | public class ExportOptions 7 | { 8 | [Option('c', "connectionstring", HelpText = "The connection string used to connect to Dynamics 365.", Required = true)] 9 | public string ConnectionString { get; set; } 10 | 11 | [Option("config", HelpText = "Path to an export configuration file.", Required = true)] 12 | public string ConfigurationFile { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Cli/ImportOptions.cs: -------------------------------------------------------------------------------- 1 | using CommandLine; 2 | 3 | namespace Capgemini.Xrm.DataMigration.Cli 4 | { 5 | [Verb("import", HelpText = "Import data into a Dynamics 365 instance.")] 6 | public class ImportOptions 7 | { 8 | [Option('c', "connectionstring", HelpText = "The connection string used to connect to Dynamics 365.", Required = true)] 9 | public string ConnectionString { get; set; } 10 | 11 | [Option("config", HelpText = "Path to an import configuration file.", Required = true)] 12 | public string ConfigurationFile { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Cli/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Capgemini.Xrm.DataMigration.Cli")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Capgemini")] 11 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.Cli")] 12 | [assembly: AssemblyCopyright("Copyright © Capgemini 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("ff1caa60-e675-450b-bc29-a03930e33cfd")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Capgemini.Xrm.DataMigration.Core.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = 3 | build_property.TargetFramework = 4 | build_property.TargetFramework = 5 | build_property.TargetFramework = 6 | build_property.TargetFramework = 7 | build_property.TargetPlatformMinVersion = 8 | build_property.TargetPlatformMinVersion = 9 | build_property.TargetPlatformMinVersion = 10 | build_property.TargetPlatformMinVersion = 11 | build_property.TargetPlatformMinVersion = 12 | build_property.UsingMicrosoftNETSdkWeb = 13 | build_property.UsingMicrosoftNETSdkWeb = 14 | build_property.UsingMicrosoftNETSdkWeb = 15 | build_property.UsingMicrosoftNETSdkWeb = 16 | build_property.UsingMicrosoftNETSdkWeb = 17 | build_property.ProjectTypeGuids = 18 | build_property.ProjectTypeGuids = 19 | build_property.ProjectTypeGuids = 20 | build_property.ProjectTypeGuids = 21 | build_property.ProjectTypeGuids = 22 | build_property.PublishSingleFile = 23 | build_property.PublishSingleFile = 24 | build_property.PublishSingleFile = 25 | build_property.PublishSingleFile = 26 | build_property.PublishSingleFile = 27 | build_property.IncludeAllContentForSelfExtract = 28 | build_property.IncludeAllContentForSelfExtract = 29 | build_property.IncludeAllContentForSelfExtract = 30 | build_property.IncludeAllContentForSelfExtract = 31 | build_property.IncludeAllContentForSelfExtract = 32 | build_property._SupportedPlatformList = 33 | build_property._SupportedPlatformList = 34 | build_property._SupportedPlatformList = 35 | build_property._SupportedPlatformList = 36 | build_property._SupportedPlatformList = 37 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Capgemini.Xrm.DataMigration.Core.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Config/ICrmStoreReaderConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Capgemini.DataMigration.Core.Model; 3 | using Capgemini.Xrm.DataMigration.Core; 4 | 5 | namespace Capgemini.Xrm.DataMigration.Config 6 | { 7 | public interface ICrmStoreReaderConfig 8 | { 9 | /// 10 | /// Gets or sets batch Size - how many items stored in one json file. 11 | /// 12 | int BatchSize { get; set; } 13 | 14 | /// 15 | /// Gets or sets a value indicating whether if true, then one entity type is returned per batch 16 | /// If false, then multiple entity types are returned. 17 | /// 18 | bool OneEntityPerBatch { get; set; } 19 | 20 | /// 21 | /// Gets or sets read page size - max 5000. 22 | /// 23 | int PageSize { get; set; } 24 | 25 | /// 26 | /// Gets or sets max Limit of items per entity. 27 | /// 28 | int TopCount { get; set; } 29 | 30 | /// 31 | /// Gets the fields to Obfuscate. 32 | /// 33 | List FieldsToObfuscate { get; } 34 | 35 | /// 36 | /// Generates FetchXMLQueries. 37 | /// 38 | /// Returns fetchxml list. 39 | List GetFetchXMLQueries(IEntityMetadataCache entityMetadataCache); 40 | } 41 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Config/ICrmStoreWriterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Capgemini.Xrm.DataMigration.Config 4 | { 5 | public interface ICrmStoreWriterConfig 6 | { 7 | /// 8 | /// Gets don't use Upsert request, use Create and Update requests instead. 9 | /// 10 | List NoUpsertEntities { get; } 11 | 12 | /// 13 | /// Gets don't use upsert or create requests - create only. 14 | /// 15 | List NoUpdateEntities { get; } 16 | 17 | /// 18 | /// Gets or sets batch size used for executemultiple request. 19 | /// 20 | int SaveBatchSize { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Config/IFileStoreReaderConfig.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.Xrm.DataMigration.Config 2 | { 3 | public interface IFileStoreReaderConfig 4 | { 5 | /// 6 | /// Gets or sets preFix for JSON files. 7 | /// 8 | string FilePrefix { get; set; } 9 | 10 | /// 11 | /// Gets or sets json folder with exported files. 12 | /// 13 | string JsonFolderPath { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Config/IFileStoreWriterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Capgemini.DataMigration.Core.Model; 3 | 4 | namespace Capgemini.Xrm.DataMigration.Config 5 | { 6 | public interface IFileStoreWriterConfig : IFileStoreReaderConfig 7 | { 8 | /// 9 | /// Gets or sets a value indicating whether creates a seperate file per entity. 10 | /// 11 | bool SeperateFilesPerEntity { get; set; } 12 | 13 | /// 14 | /// Gets excluded fields from the output file. 15 | /// 16 | List ExcludedFields { get; } 17 | 18 | /// 19 | /// Gets the fields that must be obfuscated. 20 | /// 21 | List FieldsToObfuscate { get; } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Config/JsonSerializerConfig.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Capgemini.Xrm.DataMigration.Config 4 | { 5 | public static class JsonSerializerConfig 6 | { 7 | private static JsonSerializerSettings serializerSettings; 8 | 9 | public static JsonSerializerSettings SerializerSettings 10 | { 11 | get 12 | { 13 | if (serializerSettings == null) 14 | { 15 | serializerSettings = new JsonSerializerSettings 16 | { 17 | TypeNameHandling = TypeNameHandling.None, 18 | NullValueHandling = NullValueHandling.Ignore, 19 | Formatting = Formatting.Indented 20 | }; 21 | } 22 | 23 | return serializerSettings; 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Config/MappingConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Capgemini.Xrm.DataMigration.Config 5 | { 6 | [Serializable] 7 | public class MappingConfiguration 8 | { 9 | public bool ApplyAliasMapping { get; set; } = true; 10 | 11 | public Dictionary> Mappings { get; } = new Dictionary>(); 12 | 13 | public string SourceRootBUName { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Config/ObjectTypeCodeMappingConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Capgemini.Xrm.DataMigration.Config 5 | { 6 | [Serializable] 7 | public class ObjectTypeCodeMappingConfiguration 8 | { 9 | public ObjectTypeCodeMappingConfiguration() 10 | { 11 | EntityToTypeCodeMapping = new Dictionary(); 12 | FieldsToSearchForMapping = new List(); 13 | } 14 | 15 | /// 16 | /// Gets mapping of logical names to entity type codes in the source organisation. 17 | /// 18 | public Dictionary EntityToTypeCodeMapping { get; } 19 | 20 | /// 21 | /// Gets a list of field logical names to map entity type codes for. 22 | /// 23 | public List FieldsToSearchForMapping { get; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/GenericCrmDataMigrator.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using Capgemini.DataMigration.Core; 3 | using Capgemini.Xrm.DataMigration.DataStore; 4 | using Microsoft.Xrm.Sdk; 5 | 6 | namespace Capgemini.Xrm.DataMigration.Core 7 | { 8 | public class GenericCrmDataMigrator : GenericDataMigrator, IGenericCrmDataMigrator 9 | { 10 | public GenericCrmDataMigrator(ILogger logger, IDataStoreReader storeReader, IDataStoreWriter storeWriter) 11 | : base(logger, storeReader, storeWriter) 12 | { 13 | } 14 | 15 | public GenericCrmDataMigrator(ILogger logger, IDataStoreReader storeReader, IDataStoreWriter storeWriter, CancellationToken cancellationToken) 16 | : base(logger, storeReader, storeWriter, cancellationToken) 17 | { 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/IEntityMetadataCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Capgemini.Xrm.DataMigration.Model; 3 | using Microsoft.Xrm.Sdk.Metadata; 4 | 5 | namespace Capgemini.Xrm.DataMigration.Core 6 | { 7 | public interface IEntityMetadataCache 8 | { 9 | EntityMetadata GetEntityMetadata(string entityName); 10 | 11 | ManyToManyDetails GetManyToManyEntityDetails(string intersectEntityName); 12 | 13 | Type GetAttributeDotNetType(string entityName, string attributeName); 14 | 15 | AttributeMetadata GetAttribute(string entityName, string attributeName); 16 | 17 | bool ContainsAttribute(string entityName, string attributeName); 18 | 19 | string GetLookUpEntityName(string entityName, string attributeName); 20 | 21 | string GetIdAliasKey(string entName); 22 | } 23 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/IEntityRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Capgemini.Xrm.DataMigration.DataStore; 4 | using Microsoft.Xrm.Sdk; 5 | using Microsoft.Xrm.Sdk.Metadata; 6 | 7 | namespace Capgemini.Xrm.DataMigration.Core 8 | { 9 | /// 10 | /// Entity repository. 11 | /// 12 | public interface IEntityRepository 13 | { 14 | IOrganizationService GetCurrentOrgService { get; } 15 | 16 | IEntityMetadataCache GetEntityMetadataCache { get; } 17 | 18 | void CreateUpdateEntities(List entities); 19 | 20 | void CreateEntities(List entities); 21 | 22 | void UpdateEntities(List entities); 23 | 24 | void AssignEntities(List entities); 25 | 26 | void AssociateManyToManyEntity(List entities); 27 | 28 | List GetEntitesByFetchXML(string fetchXMLQuery, int pageNumber, int pageSize, ref string pagingCookie); 29 | 30 | List GetAllEntitesMetadata(); 31 | 32 | List GetEntitiesByName(string entityName, string[] collumns, int pageSize); 33 | 34 | Guid GetParentBuId(); 35 | 36 | void DeleteEntity(string entityName, Guid entityId); 37 | 38 | Guid GetOrganizationId(); 39 | 40 | Guid GetGuidForMapping(string entityName, string[] filterFields, object[] filterValues); 41 | 42 | List FindEntitiesByName(string entityName, string nameValue); 43 | } 44 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/IGenericCrmDataMigrator.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using Capgemini.DataMigration.Core; 3 | using Capgemini.Xrm.DataMigration.DataStore; 4 | using Microsoft.Xrm.Sdk; 5 | 6 | namespace Capgemini.Xrm.DataMigration.Core 7 | { 8 | public interface IGenericCrmDataMigrator : IGenericDataMigrator 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/IMappingFetchCreator.cs: -------------------------------------------------------------------------------- 1 | using Capgemini.Xrm.DataMigration.Model; 2 | 3 | namespace Capgemini.Xrm.DataMigration.Core 4 | { 5 | public interface IMappingFetchCreator 6 | { 7 | /// 8 | /// produces bit of fetch xml which queries dayabase for mapping data. 9 | /// 10 | /// entityName. 11 | /// field. 12 | /// value. 13 | string GetExportFetchXML(string entityName, CrmField field); 14 | 15 | /// 16 | /// used to determine of processor neds to be executed for given enbtityt - help export performance. 17 | /// 18 | /// entityName. 19 | /// value. 20 | bool UseForEntity(string entityName); 21 | } 22 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/IMappingRule.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Microsoft.Xrm.Sdk; 3 | 4 | namespace Capgemini.Xrm.DataMigration.Core 5 | { 6 | public interface IMappingRule 7 | { 8 | /// 9 | /// finds entity guid bsed on mapping data. 10 | /// 11 | /// aliasedAttributeName. 12 | /// values. 13 | /// replacementValue. 14 | /// true if match was found and value should be replaced, false otherwise. 15 | bool ProcessImport(string aliasedAttributeName, List values, out object replacementValue); 16 | } 17 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/IProcessRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Capgemini.Xrm.DataMigration.Model; 4 | 5 | namespace Capgemini.Xrm.DataMigration.Core 6 | { 7 | public interface IProcessRepository 8 | { 9 | void ActivateWorkflow(Guid id); 10 | 11 | void DeActivateWorkflow(Guid id); 12 | 13 | List GetAllWorkflows(); 14 | 15 | List GetAllCustomizableSDKSteps(); 16 | 17 | void ActivateSDKStep(Guid id); 18 | 19 | void DeActivateSDKStep(Guid id); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/CrmEntity.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Xml.Serialization; 3 | 4 | namespace Capgemini.Xrm.DataMigration.Model 5 | { 6 | /// 7 | /// CRM SDK Configuration Migration Tool schema. 8 | /// 9 | [XmlRoot("entity")] 10 | public class CrmEntity 11 | { 12 | [XmlAttribute("name")] 13 | public string Name { get; set; } 14 | 15 | [XmlAttribute("displayname")] 16 | public string DisplayName { get; set; } 17 | 18 | [XmlAttribute("etc")] 19 | public string EntityCode { get; set; } 20 | 21 | [XmlAttribute("primaryidfield")] 22 | public string PrimaryIdField { get; set; } 23 | 24 | [XmlAttribute("primarynamefield")] 25 | public string PrimaryNameField { get; set; } 26 | 27 | [XmlAttribute("disableplugins")] 28 | public bool DisablePlugins { get; set; } 29 | 30 | [XmlArray("fields")] 31 | [XmlArrayItem("field")] 32 | public List CrmFields { get; } = new List(); 33 | 34 | [XmlArray("relationships")] 35 | [XmlArrayItem("relationship")] 36 | public List CrmRelationships { get; } = new List(); 37 | } 38 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/CrmField.cs: -------------------------------------------------------------------------------- 1 | using System.Xml.Serialization; 2 | 3 | namespace Capgemini.Xrm.DataMigration.Model 4 | { 5 | /// 6 | /// CRM SDK Configuration Migration Tool schema. 7 | /// 8 | [XmlRoot("field")] 9 | public class CrmField 10 | { 11 | [XmlAttribute("displayname")] 12 | public string DisplayName { get; set; } 13 | 14 | [XmlAttribute("name")] 15 | public string FieldName { get; set; } 16 | 17 | [XmlAttribute("type")] 18 | public string FieldType { get; set; } 19 | 20 | [XmlAttribute("primaryKey")] 21 | public bool PrimaryKey { get; set; } 22 | 23 | [XmlAttribute("lookupType")] 24 | public string LookupType { get; set; } 25 | 26 | [XmlAttribute("customfield")] 27 | public bool CustomField { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/CrmRelationship.cs: -------------------------------------------------------------------------------- 1 | using System.Xml.Serialization; 2 | 3 | namespace Capgemini.Xrm.DataMigration.Model 4 | { 5 | /// 6 | /// CRM SDK Configuration Migration Tool schema. 7 | /// 8 | [XmlRoot("relationship")] 9 | public class CrmRelationship 10 | { 11 | [XmlAttribute("name")] 12 | public string RelationshipName { get; set; } 13 | 14 | [XmlAttribute("manyToMany")] 15 | public bool ManyToMany { get; set; } 16 | 17 | [XmlAttribute("isreflexive")] 18 | public bool IsReflexive { get; set; } 19 | 20 | [XmlAttribute("relatedEntityName")] 21 | public string RelatedEntityName { get; set; } 22 | 23 | [XmlAttribute("m2mTargetEntity")] 24 | public string TargetEntityName { get; set; } 25 | 26 | [XmlAttribute("m2mTargetEntityPrimaryKey")] 27 | public string TargetEntityPrimaryKey { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/EntityFields.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.Xrm.DataMigration.Model 2 | { 3 | public static class EntityFields 4 | { 5 | public const string OwnerId = "ownerid"; 6 | 7 | public const string StateCode = "statecode"; 8 | 9 | public const string StatusCode = "statuscode"; 10 | } 11 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/ManyToManyDetails.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.Xrm.DataMigration.Model 2 | { 3 | public class ManyToManyDetails 4 | { 5 | public bool IsManyToMany { get; set; } 6 | 7 | public string SchemaName { get; set; } 8 | 9 | public string Entity1LogicalName { get; set; } 10 | 11 | public string Entity2LogicalName { get; set; } 12 | 13 | public string Entity1IntersectAttribute { get; set; } 14 | 15 | public string Entity2IntersectAttribute { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/PassType.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.Xrm.DataMigration.Model 2 | { 3 | public enum PassType 4 | { 5 | CreateRequiredEntity = 0, 6 | CreateEntity = 1, 7 | UpdateLookups = 2, 8 | SetRecordStatus = 3, 9 | AssignRecord = 4 10 | } 11 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/SDKStepStatusCode.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.Xrm.DataMigration.Model 2 | { 3 | public enum SdkSepStatusCode 4 | { 5 | Enabled = 1, 6 | Disabled = 2, 7 | } 8 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/SdkStep.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Capgemini.Xrm.DataMigration.Model 4 | { 5 | public class SdkStep 6 | { 7 | public Guid Id { get; set; } 8 | 9 | public string Name { get; set; } 10 | 11 | public string Handler { get; set; } 12 | 13 | public SdkStepState SDKStepState { get; set; } 14 | 15 | public SdkSepStatusCode SDKSepStatusCode { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/SdkStepState1.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.Xrm.DataMigration.Model 2 | { 3 | public enum SdkStepState 4 | { 5 | Enabled = 0, 6 | Disabled = 1 7 | } 8 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/WorkflowCategory.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.Xrm.DataMigration.Model 2 | { 3 | public enum WorkflowCategory 4 | { 5 | Workflow = 0, 6 | Dialog = 1, 7 | BusinessRule = 2, 8 | Action = 3, 9 | BusinessProcessFlow = 4 10 | } 11 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/WorkflowEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Xrm.Sdk; 3 | 4 | namespace Capgemini.Xrm.DataMigration.Model 5 | { 6 | public class WorkflowEntity 7 | { 8 | public WorkflowEntity(Guid id, string name, string rendererObjectTypeCode, OptionSetValue wfType, OptionSetValue category, OptionSetValue statuscode, OptionSetValue statecode) 9 | { 10 | Id = id; 11 | Name = name; 12 | RendererObjectTypeCode = rendererObjectTypeCode; 13 | WfType = wfType != null ? (WorkflowType)wfType.Value : (WorkflowType?)null; 14 | WfCategory = category != null ? (WorkflowCategory)category.Value : (WorkflowCategory?)null; 15 | WfStatus = statuscode != null ? (WorkflowStatusCode)statuscode.Value : (WorkflowStatusCode?)null; 16 | WfState = statecode != null ? (WorkflowState)statecode.Value : (WorkflowState?)null; 17 | } 18 | 19 | public Guid Id { get; set; } 20 | 21 | public string Name { get; set; } 22 | 23 | public string RendererObjectTypeCode { get; set; } 24 | 25 | public WorkflowState? WfState { get; set; } 26 | 27 | public WorkflowStatusCode? WfStatus { get; set; } 28 | 29 | public WorkflowCategory? WfCategory { get; set; } 30 | 31 | public WorkflowType? WfType { get; set; } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/WorkflowState.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.Xrm.DataMigration.Model 2 | { 3 | public enum WorkflowState 4 | { 5 | Draft = 0, 6 | Activated = 1 7 | } 8 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/WorkflowStatusCode.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.Xrm.DataMigration.Model 2 | { 3 | public enum WorkflowStatusCode 4 | { 5 | Draft = 1, 6 | Activated = 2 7 | } 8 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Model/WorkflowType.cs: -------------------------------------------------------------------------------- 1 | namespace Capgemini.Xrm.DataMigration.Model 2 | { 3 | public enum WorkflowType 4 | { 5 | Definition = 1, 6 | Activation = 2, 7 | Template = 3 8 | } 9 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Capgemini.Xrm.DataMigration.Core")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Capgemini")] 11 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.Core")] 12 | [assembly: AssemblyCopyright("Copyright © Capgemini Corporation 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("b9c0e463-c42a-4f5c-bd36-e69c93c959b2")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.0.0.0")] 35 | [assembly: AssemblyFileVersion("2.0.0.0")] -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Core/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.CrmStore/Capgemini.Xrm.DataMigration.CrmStore.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = 3 | build_property.TargetFramework = 4 | build_property.TargetFramework = 5 | build_property.TargetFramework = 6 | build_property.TargetFramework = 7 | build_property.TargetPlatformMinVersion = 8 | build_property.TargetPlatformMinVersion = 9 | build_property.TargetPlatformMinVersion = 10 | build_property.TargetPlatformMinVersion = 11 | build_property.TargetPlatformMinVersion = 12 | build_property.UsingMicrosoftNETSdkWeb = 13 | build_property.UsingMicrosoftNETSdkWeb = 14 | build_property.UsingMicrosoftNETSdkWeb = 15 | build_property.UsingMicrosoftNETSdkWeb = 16 | build_property.UsingMicrosoftNETSdkWeb = 17 | build_property.ProjectTypeGuids = 18 | build_property.ProjectTypeGuids = 19 | build_property.ProjectTypeGuids = 20 | build_property.ProjectTypeGuids = 21 | build_property.ProjectTypeGuids = 22 | build_property.PublishSingleFile = 23 | build_property.PublishSingleFile = 24 | build_property.PublishSingleFile = 25 | build_property.PublishSingleFile = 26 | build_property.PublishSingleFile = 27 | build_property.IncludeAllContentForSelfExtract = 28 | build_property.IncludeAllContentForSelfExtract = 29 | build_property.IncludeAllContentForSelfExtract = 30 | build_property.IncludeAllContentForSelfExtract = 31 | build_property.IncludeAllContentForSelfExtract = 32 | build_property._SupportedPlatformList = 33 | build_property._SupportedPlatformList = 34 | build_property._SupportedPlatformList = 35 | build_property._SupportedPlatformList = 36 | build_property._SupportedPlatformList = 37 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.CrmStore/Capgemini.Xrm.DataMigration.CrmStore.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.CrmStore/Config/CrmStoreReaderConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Capgemini.DataMigration.Core.Model; 3 | using Capgemini.Xrm.DataMigration.Config; 4 | using Capgemini.Xrm.DataMigration.Core; 5 | 6 | namespace Capgemini.Xrm.DataMigration.CrmStore.Config 7 | { 8 | public class CrmStoreReaderConfig : ICrmStoreReaderConfig 9 | { 10 | private readonly List fetchXMlQueries; 11 | 12 | public CrmStoreReaderConfig(List fetchXMlQueries) 13 | { 14 | this.fetchXMlQueries = fetchXMlQueries; 15 | } 16 | 17 | public int BatchSize { get; set; } = 500; 18 | 19 | public bool OneEntityPerBatch { get; set; } = true; 20 | 21 | public int PageSize { get; set; } = 500; 22 | 23 | public int TopCount { get; set; } = 500; 24 | 25 | /// 26 | /// Gets the fields to Obfuscate. 27 | /// 28 | public List FieldsToObfuscate { get; private set; } = new List(); 29 | 30 | public List GetFetchXMLQueries(IEntityMetadataCache entityMetadataCache) 31 | { 32 | return fetchXMlQueries; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.CrmStore/Config/CrmStoreWriterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Capgemini.Xrm.DataMigration.Config; 3 | 4 | namespace Capgemini.Xrm.DataMigration.CrmStore.Config 5 | { 6 | public class CrmStoreWriterConfig : ICrmStoreWriterConfig 7 | { 8 | public List NoUpsertEntities { get; private set; } = new List(); 9 | 10 | public int SaveBatchSize { get; set; } = 500; 11 | 12 | public List NoUpdateEntities { get; private set; } = new List(); 13 | } 14 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.CrmStore/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Capgemini.Xrm.DataMigration.CrmStore")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Capgemini")] 11 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.CrmStore")] 12 | [assembly: AssemblyCopyright("Capgemini © Microsoft Corporation 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("ddb8de01-5fdc-4f9c-9c26-bdc4f3436a10")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.0.1.0")] 35 | [assembly: AssemblyFileVersion("2.0.1.0")] -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.CrmStore/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.CrmStore/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/Capgemini.Xrm.DataMigration.Engine.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = 3 | build_property.TargetFramework = 4 | build_property.TargetFramework = 5 | build_property.TargetFramework = 6 | build_property.TargetFramework = 7 | build_property.TargetPlatformMinVersion = 8 | build_property.TargetPlatformMinVersion = 9 | build_property.TargetPlatformMinVersion = 10 | build_property.TargetPlatformMinVersion = 11 | build_property.TargetPlatformMinVersion = 12 | build_property.UsingMicrosoftNETSdkWeb = 13 | build_property.UsingMicrosoftNETSdkWeb = 14 | build_property.UsingMicrosoftNETSdkWeb = 15 | build_property.UsingMicrosoftNETSdkWeb = 16 | build_property.UsingMicrosoftNETSdkWeb = 17 | build_property.ProjectTypeGuids = 18 | build_property.ProjectTypeGuids = 19 | build_property.ProjectTypeGuids = 20 | build_property.ProjectTypeGuids = 21 | build_property.ProjectTypeGuids = 22 | build_property.PublishSingleFile = 23 | build_property.PublishSingleFile = 24 | build_property.PublishSingleFile = 25 | build_property.PublishSingleFile = 26 | build_property.PublishSingleFile = 27 | build_property.IncludeAllContentForSelfExtract = 28 | build_property.IncludeAllContentForSelfExtract = 29 | build_property.IncludeAllContentForSelfExtract = 30 | build_property.IncludeAllContentForSelfExtract = 31 | build_property.IncludeAllContentForSelfExtract = 32 | build_property._SupportedPlatformList = 33 | build_property._SupportedPlatformList = 34 | build_property._SupportedPlatformList = 35 | build_property._SupportedPlatformList = 36 | build_property._SupportedPlatformList = 37 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/Capgemini.Xrm.DataMigration.Engine.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Capgemini.Xrm.DataMigration.Engine 5 | 0.0.0 6 | Capgemini Xrm DataMigration Engine 7 | Capgemini 8 | Capgemini 9 | MIT 10 | true 11 | https://github.com/Capgemini/xrm-datamigration 12 | 13 | Capgemini DataMigration Engine - Export/Import of CRM Data allowing management and release in the same way as code. The engine supports JSON and CSV file formats. 14 | Capgemini Copyright © 2023 15 | Capgemini.Xrm.DataMigration, DataMigration, Xrm 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/Capgemini.Xrm.DataMigration.Engine.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/CrmDirectMigrator.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using Capgemini.DataMigration.Core; 3 | using Capgemini.Xrm.DataMigration.Config; 4 | using Capgemini.Xrm.DataMigration.Core; 5 | using Capgemini.Xrm.DataMigration.CrmStore.DataStores; 6 | 7 | namespace Capgemini.Xrm.DataMigration.Engine 8 | { 9 | /// 10 | /// Directly Exports data from one CRM and imports to anther one 11 | /// Entity processing required. 12 | /// 13 | public class CrmDirectMigrator : CrmGenericImporter 14 | { 15 | public CrmDirectMigrator(ILogger logger, DataCrmStoreReader storeReader, DataCrmStoreWriter storeWriter, ICrmGenericImporterConfig config) 16 | : base(logger, storeReader, storeWriter, config) 17 | { 18 | } 19 | 20 | public CrmDirectMigrator(ILogger logger, DataCrmStoreReader storeReader, DataCrmStoreWriter storeWriter, ICrmGenericImporterConfig config, CancellationToken token) 21 | : base(logger, storeReader, storeWriter, config, token) 22 | { 23 | } 24 | 25 | public CrmDirectMigrator(ILogger logger, IEntityRepository entityRepo, ICrmStoreReaderConfig readerConfig, ICrmStoreWriterConfig writerConfig, ICrmGenericImporterConfig importConfig, CancellationToken token) 26 | : base( 27 | logger, 28 | new DataCrmStoreReader(logger, entityRepo, readerConfig), 29 | new DataCrmStoreWriter(logger, entityRepo, writerConfig, token), 30 | importConfig, 31 | token) 32 | { 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/MappingRules/BusinessUnitRootRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Capgemini.DataMigration.Core.Extensions; 5 | using Capgemini.Xrm.DataMigration.Core; 6 | using Microsoft.Xrm.Sdk; 7 | 8 | namespace Capgemini.Xrm.DataMigration.Engine.MappingRules 9 | { 10 | /// 11 | /// this rules allowas mapping to rot BU. return aliased value in fomrat map.fieldname.isRootBu when lookup points to root BU. Whn it;s regular chuld BU, such enatry wil not be created. 12 | /// During import, if such value is encountred, lookup will be transalted to root BU. 13 | /// 14 | public class BusinessUnitRootRule : IMappingRule 15 | { 16 | private readonly Guid parentBuId; 17 | 18 | public BusinessUnitRootRule(Guid parentBuId) 19 | { 20 | this.parentBuId = parentBuId; 21 | } 22 | 23 | public bool ProcessImport(string aliasedAttributeName, List values, out object replacementValue) 24 | { 25 | aliasedAttributeName.ThrowArgumentNullExceptionIfNull(nameof(aliasedAttributeName)); 26 | 27 | string entName = values.Select(p => p.EntityLogicalName).Distinct().Single(); 28 | 29 | bool processedValued = false; 30 | replacementValue = null; 31 | if (entName == "businessunit" && aliasedAttributeName.Split(new char[] { '.' })[2] == "isRootBU") 32 | { 33 | replacementValue = parentBuId; 34 | processedValued = true; 35 | } 36 | 37 | return processedValued; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/Obfuscate/ICrmObfuscateHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Capgemini.DataMigration.Core.Model; 3 | using Capgemini.Xrm.DataMigration.Core; 4 | using Microsoft.Xrm.Sdk; 5 | 6 | namespace Capgemini.Xrm.DataMigration.Engine.Obfuscate 7 | { 8 | public interface ICrmObfuscateHandler 9 | { 10 | bool CanHandle(Type type); 11 | 12 | void HandleObfuscation(Entity entity, FieldToBeObfuscated field, IEntityMetadataCache metaData); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/Obfuscate/ObfuscationType/Formatting/FormattingOptions/FormattingOptionLookup.cs: -------------------------------------------------------------------------------- 1 | using Capgemini.DataMigration.Core.Helpers; 2 | using Capgemini.DataMigration.Core.Model; 3 | 4 | namespace Capgemini.Xrm.DataMigration.Engine.Obfuscate.ObfuscationType.Formatting.FormattingOptions 5 | { 6 | public class FormattingOptionLookup 7 | { 8 | public virtual ObfuscationLookup GetObfuscationLookup(string fileName) 9 | { 10 | return ObfuscationLookupHelper.ObfuscationLookups[fileName]; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/Obfuscate/ObfuscationType/Formatting/IObfuscationFormattingType.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Capgemini.DataMigration.Core.Model; 3 | 4 | namespace Capgemini.Xrm.DataMigration.Engine.Obfuscate.ObfuscationType.Formatting 5 | { 6 | public interface IObfuscationFormattingType 7 | { 8 | T CreateFormattedValue(T originalValue, FieldToBeObfuscated field, Dictionary metadataParameters); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Capgemini Data Migration Engine")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Capgemini")] 11 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.Engine")] 12 | [assembly: AssemblyCopyright("Copyright © Capgemini Corporation 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("0fb0162d-0b31-4c5b-a657-f4f3579778ec")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.0.0.0")] 35 | [assembly: AssemblyFileVersion("2.0.0.0")] -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.Engine/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.FileStore/Capgemini.Xrm.DataMigration.FileStore.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = 3 | build_property.TargetFramework = 4 | build_property.TargetFramework = 5 | build_property.TargetFramework = 6 | build_property.TargetFramework = 7 | build_property.TargetPlatformMinVersion = 8 | build_property.TargetPlatformMinVersion = 9 | build_property.TargetPlatformMinVersion = 10 | build_property.TargetPlatformMinVersion = 11 | build_property.TargetPlatformMinVersion = 12 | build_property.UsingMicrosoftNETSdkWeb = 13 | build_property.UsingMicrosoftNETSdkWeb = 14 | build_property.UsingMicrosoftNETSdkWeb = 15 | build_property.UsingMicrosoftNETSdkWeb = 16 | build_property.UsingMicrosoftNETSdkWeb = 17 | build_property.ProjectTypeGuids = 18 | build_property.ProjectTypeGuids = 19 | build_property.ProjectTypeGuids = 20 | build_property.ProjectTypeGuids = 21 | build_property.ProjectTypeGuids = 22 | build_property.PublishSingleFile = 23 | build_property.PublishSingleFile = 24 | build_property.PublishSingleFile = 25 | build_property.PublishSingleFile = 26 | build_property.PublishSingleFile = 27 | build_property.IncludeAllContentForSelfExtract = 28 | build_property.IncludeAllContentForSelfExtract = 29 | build_property.IncludeAllContentForSelfExtract = 30 | build_property.IncludeAllContentForSelfExtract = 31 | build_property.IncludeAllContentForSelfExtract = 32 | build_property._SupportedPlatformList = 33 | build_property._SupportedPlatformList = 34 | build_property._SupportedPlatformList = 35 | build_property._SupportedPlatformList = 36 | build_property._SupportedPlatformList = 37 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.FileStore/Capgemini.Xrm.DataMigration.FileStore.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.FileStore/Config/FileStoreReaderConfig.cs: -------------------------------------------------------------------------------- 1 | using Capgemini.Xrm.DataMigration.Config; 2 | 3 | namespace Capgemini.Xrm.DataMigration.FileStore.Config 4 | { 5 | public class FileStoreReaderConfig : IFileStoreReaderConfig 6 | { 7 | /// 8 | /// Gets or sets preFix for JSON files. 9 | /// 10 | public string FilePrefix { get; set; } = "ExportedData"; 11 | 12 | /// 13 | /// Gets or sets json folder with exported files. 14 | /// 15 | public string JsonFolderPath { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.FileStore/Config/FileStoreWriterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Capgemini.DataMigration.Core.Model; 3 | using Capgemini.Xrm.DataMigration.Config; 4 | 5 | namespace Capgemini.Xrm.DataMigration.FileStore.Config 6 | { 7 | public class FileStoreWriterConfig : FileStoreReaderConfig, IFileStoreWriterConfig 8 | { 9 | /// 10 | /// Gets or sets a value indicating whether creates a seperate file per entity. 11 | /// 12 | public bool SeperateFilesPerEntity { get; set; } = true; 13 | 14 | /// 15 | /// Gets excluded Fields from the output file. 16 | /// 17 | public List ExcludedFields { get; } = new List(); 18 | 19 | /// 20 | /// Gets the fields that must be obfuscated. 21 | /// 22 | public List FieldsToObfuscate { get; } = new List(); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.FileStore/Model/CrmAttributeStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Microsoft.Xrm.Sdk; 5 | 6 | namespace Capgemini.Xrm.DataMigration.FileStore.Model 7 | { 8 | /// 9 | /// CrmAttributeStore. 10 | /// 11 | [Serializable] 12 | public class CrmAttributeStore 13 | { 14 | public CrmAttributeStore() 15 | { 16 | } 17 | 18 | public CrmAttributeStore(KeyValuePair attribute) 19 | { 20 | AttributeName = attribute.Key; 21 | AttributeType = attribute.Value.GetType().ToString(); 22 | 23 | if (AttributeType == "Microsoft.Xrm.Sdk.EntityCollection") 24 | { 25 | var ec = (EntityCollection)attribute.Value; 26 | AttributeValue = ec.Entities.Select(e => new CrmEntityStore(e)).ToList(); 27 | } 28 | else 29 | { 30 | AttributeValue = attribute.Value; 31 | } 32 | } 33 | 34 | public string AttributeName { get; set; } 35 | 36 | public object AttributeValue { get; set; } 37 | 38 | public string AttributeType { get; set; } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.FileStore/Model/CrmExportedDataStore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Capgemini.Xrm.DataMigration.FileStore.Model 5 | { 6 | /// 7 | /// A class used to store all required data - schema od the file with data. 8 | /// 9 | [Serializable] 10 | public class CrmExportedDataStore 11 | { 12 | public CrmExportedDataStore() 13 | { 14 | ExportedEntities = new List(); 15 | } 16 | 17 | public int RecordsCount { get; set; } 18 | 19 | public List ExportedEntities { get; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.FileStore/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Capgemini.Xrm.DataMigration.FileStore")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Capgemini")] 11 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.FileStore")] 12 | [assembly: AssemblyCopyright("Copyright © Capgemini Corporation 2018")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("15394533-d8ae-4f0f-9263-be9e94f12336")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.0.0.0")] 35 | [assembly: AssemblyFileVersion("2.0.0.0")] -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.FileStore/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Capgemini.Xrm.DataMigration.FileStore/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "layoutRules": { 5 | "newlineAtEndOfFile": "omit" 6 | }, 7 | "orderingRules": { 8 | "usingDirectivesPlacement": "outsideNamespace", 9 | "systemUsingDirectivesFirst": true, 10 | "orderingRules": { 11 | "elementOrder": [ 12 | "kind", 13 | "constant", 14 | "accessibility", 15 | "static", 16 | "readonly" 17 | ] 18 | } 19 | }, 20 | "readabilityRules": { "allowBuiltInTypeAliases": true }, 21 | "documentationRules": { 22 | "xmlHeader": false, 23 | "documentationCulture": "en-GB" 24 | }, 25 | "indentation": {}, 26 | "maintainabilityRules": { 27 | "topLevelTypes": [ "class", "interface", "enum", "struct" ] 28 | }, 29 | "namingRules": { 30 | "allowCommonHungarianPrefixes": false, 31 | "tupleElementNameCasing": "camelCase" 32 | }, 33 | "spacingRules": {} 34 | } 35 | } -------------------------------------------------------------------------------- /tests/Capgemini.DataMigration.Core.Tests.Base/Helpers/FileManager.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace Capgemini.DataMigration.Core.Tests.Base.Helpers 4 | { 5 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 6 | public static class FileManager 7 | { 8 | public static void DeleteAllContentsFromFolder(string path) 9 | { 10 | if (Directory.Exists(path)) 11 | { 12 | var files = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories); 13 | foreach (var item in files) 14 | { 15 | DeleteFile(item); 16 | } 17 | } 18 | } 19 | 20 | public static void DeleteFile(string file) 21 | { 22 | if (File.Exists(file)) 23 | { 24 | File.Delete(file); 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /tests/Capgemini.DataMigration.Core.Tests.Base/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Capgemini.DataMigration.Core.Tests.Base")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("Capgemini.DataMigration.Core.Tests.Base")] 12 | [assembly: AssemblyCopyright("Copyright © 2019")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("dc7ae702-e957-455f-a0c4-630ff6827601")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /tests/Capgemini.DataMigration.Core.Tests.Base/TestMigrationEntityWrapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using Capgemini.DataMigration.DataStore; 4 | using Microsoft.Xrm.Sdk; 5 | 6 | namespace Capgemini.DataMigration.Core.Tests.Base 7 | { 8 | [ExcludeFromCodeCoverage] 9 | public class TestMigrationEntityWrapper : MigrationEntityWrapper 10 | { 11 | public TestMigrationEntityWrapper(Entity entity, bool isManyToMany = false) 12 | : base(entity, isManyToMany) 13 | { 14 | } 15 | 16 | public override Guid Id => Guid.NewGuid(); 17 | 18 | public override string LogicalName => nameof(TestMigrationEntityWrapper); 19 | 20 | public override int AttributesCount => 1; 21 | } 22 | } -------------------------------------------------------------------------------- /tests/Capgemini.DataMigration.Core.Tests.Base/TestRetryExecutor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using Capgemini.DataMigration.Resiliency; 4 | 5 | namespace Capgemini.DataMigration.Core.Tests.Base 6 | { 7 | [ExcludeFromCodeCoverage] 8 | public class TestRetryExecutor : IRetryExecutor 9 | { 10 | public T Execute(Func p) 11 | { 12 | if (p == null) 13 | { 14 | return default(T); 15 | } 16 | 17 | return p.Invoke(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /tests/Capgemini.DataMigration.Core.Tests.Base/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/Capgemini.DataMigration.Core.Tests.Base/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/Capgemini.DataMigration.Core.Tests.Unit/Exceptions/ConfigurationExceptionTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using FluentAssertions; 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | 6 | namespace Capgemini.DataMigration.Exceptions.Tests 7 | { 8 | [ExcludeFromCodeCoverage] 9 | [TestClass] 10 | public class ConfigurationExceptionTests 11 | { 12 | private ConfigurationException systemUnderTest; 13 | 14 | [TestMethod] 15 | public void ConfigurationException() 16 | { 17 | FluentActions.Invoking(() => systemUnderTest = new ConfigurationException()) 18 | .Should() 19 | .NotThrow(); 20 | } 21 | 22 | [TestMethod] 23 | public void ConfigurationExceptionWithStringParameter() 24 | { 25 | var message = "Test message"; 26 | 27 | FluentActions.Invoking(() => systemUnderTest = new ConfigurationException(message)) 28 | .Should() 29 | .NotThrow(); 30 | 31 | Assert.AreEqual(message, systemUnderTest.Message); 32 | } 33 | 34 | [TestMethod] 35 | public void ConfigurationExceptionWithStringAndInnerException() 36 | { 37 | var message = "Test message"; 38 | 39 | FluentActions.Invoking(() => systemUnderTest = new ConfigurationException(message, new Exception())) 40 | .Should() 41 | .NotThrow(); 42 | 43 | Assert.AreEqual(message, systemUnderTest.Message); 44 | Assert.IsNotNull(systemUnderTest.InnerException); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /tests/Capgemini.DataMigration.Core.Tests.Unit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("Capgemini.DataMigration.Core.Tests.Unit")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("")] 8 | [assembly: AssemblyProduct("Capgemini.DataMigration.Core.Tests.Unit")] 9 | [assembly: AssemblyCopyright("Copyright © 2019")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | [assembly: ComVisible(false)] 13 | [assembly: Guid("9ce399d0-687e-4096-bf2e-63735c446f21")] 14 | 15 | // [assembly: AssemblyVersion("1.0.*")] 16 | [assembly: AssemblyVersion("1.0.0.0")] 17 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /tests/Capgemini.DataMigration.Core.Tests.Unit/TestData/LookupFiles/EmptyFolder/EmptyFile.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /tests/Capgemini.DataMigration.Core.Tests.Unit/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/Capgemini.DataScrambler.Tests.Unit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("Capgemini.DataScrambler.Tests.Unit")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("Capgemini.DataScrambler.Tests.Unit")] 10 | [assembly: AssemblyCopyright("Copyright © 2020")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: ComVisible(false)] 15 | 16 | [assembly: Guid("768db632-8bb1-4dcf-b122-19f7feafa233")] 17 | 18 | // [assembly: AssemblyVersion("1.0.*")] 19 | [assembly: AssemblyVersion("1.0.0.0")] 20 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /tests/Capgemini.DataScrambler.Tests.Unit/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Core.IntegrationTests/ExtensionTests/OrgServiceExtensionsTest.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Diagnostics.CodeAnalysis; 3 | using Capgemini.Xrm.DataMigration.Extensions; 4 | using FluentAssertions; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | using Microsoft.Xrm.Sdk.Query; 7 | 8 | namespace Capgemini.Xrm.DataMigration.Core.IntegrationTests.ExtensionTests 9 | { 10 | [ExcludeFromCodeCoverage] 11 | [TestClass] 12 | public class OrgServiceExtensionsTest 13 | { 14 | [TestMethod] 15 | public void GetDataByQueryNoEntitiesReturned() 16 | { 17 | var service = ConnectionHelper.GetOrganizationalServiceSource(); 18 | 19 | var watch = Stopwatch.StartNew(); 20 | 21 | QueryExpression exp = new QueryExpression("contact") 22 | { 23 | ColumnSet = new ColumnSet(false) 24 | }; 25 | Microsoft.Xrm.Sdk.EntityCollection result = null; 26 | 27 | FluentActions.Invoking(() => result = service.GetDataByQuery(exp, 5000, false)) 28 | .Should() 29 | .NotThrow(); 30 | 31 | watch.Stop(); 32 | Debug.WriteLine($"Count took {watch.Elapsed.Seconds} seconds, result {result.TotalRecordCount}"); 33 | 34 | result.Should().NotBeNull(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Core.IntegrationTests/Helpers/ConnectionHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Configuration; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Globalization; 4 | using Microsoft.Xrm.Sdk; 5 | using Microsoft.Xrm.Tooling.Connector; 6 | 7 | namespace Capgemini.Xrm.DataMigration.Core.IntegrationTests 8 | { 9 | [ExcludeFromCodeCoverage] 10 | public static class ConnectionHelper 11 | { 12 | public static IOrganizationService GetOrganizationalServiceSource() 13 | { 14 | return GetOrganizationalService(ConfigurationManager.ConnectionStrings["CrmSource"].ConnectionString); 15 | } 16 | 17 | public static IOrganizationService GetOrganizationalServiceTarget() 18 | { 19 | return GetOrganizationalService(ConfigurationManager.ConnectionStrings["CrmTarget"].ConnectionString); 20 | } 21 | 22 | private static IOrganizationService GetOrganizationalService(string connectionString) 23 | { 24 | if (!connectionString.ToUpper(CultureInfo.InvariantCulture).Contains("REQUIRENEWINSTANCE=TRUE")) 25 | { 26 | connectionString = $"RequireNewInstance=True; {connectionString}"; 27 | } 28 | 29 | CrmServiceClient.MaxConnectionTimeout = new System.TimeSpan(1, 0, 0); 30 | return new CrmServiceClient(connectionString); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Core.IntegrationTests/Helpers/RetryMockHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using Capgemini.DataMigration.Resiliency; 3 | using Moq; 4 | 5 | namespace Capgemini.Xrm.DataMigration.Core.IntegrationTests 6 | { 7 | [ExcludeFromCodeCoverage] 8 | public static class RetryMockHelper 9 | { 10 | public static IRetryExecutor GetMockExecutor() 11 | { 12 | var mock = new Mock(); 13 | return mock.Object; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Core.IntegrationTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Capgemini.Xrm.DataMigration.Core.IntegrationTests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Microsoft Corporation")] 11 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.Core.IntegrationTests")] 12 | [assembly: AssemblyCopyright("Copyright © Microsoft Corporation 2017")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("e51de4c0-3e6c-49e6-be46-1d66e65f68b5")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Core.IntegrationTests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Core.Tests.Unit/Exceptions/ValidationExceptionTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using FluentAssertions; 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | 6 | namespace Capgemini.DataMigration.Exceptions.Tests 7 | { 8 | [ExcludeFromCodeCoverage] 9 | [TestClass] 10 | public class ValidationExceptionTests 11 | { 12 | private ValidationException systemUnderTest; 13 | 14 | [TestMethod] 15 | public void ValidationException() 16 | { 17 | FluentActions.Invoking(() => systemUnderTest = new ValidationException()) 18 | .Should() 19 | .NotThrow(); 20 | } 21 | 22 | [TestMethod] 23 | public void ValidationExceptionWithStringParameter() 24 | { 25 | var message = "Test message"; 26 | 27 | FluentActions.Invoking(() => systemUnderTest = new ValidationException(message)) 28 | .Should() 29 | .NotThrow(); 30 | 31 | Assert.AreEqual(message, systemUnderTest.Message); 32 | } 33 | 34 | [TestMethod] 35 | public void ValidationExceptionWithStringAndInnerException() 36 | { 37 | var message = "Test message"; 38 | 39 | FluentActions.Invoking(() => systemUnderTest = new ValidationException(message, new Exception())) 40 | .Should() 41 | .NotThrow(); 42 | 43 | Assert.AreEqual(message, systemUnderTest.Message); 44 | Assert.IsNotNull(systemUnderTest.InnerException); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Core.Tests.Unit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("Capgemini.Xrm.DataMigration.Core.Tests.Unit")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("")] 8 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.Core.Tests.Unit")] 9 | [assembly: AssemblyCopyright("Copyright © 2019")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | [assembly: ComVisible(false)] 13 | [assembly: Guid("d805eb24-7909-4e58-8091-cada2b03dbd3")] 14 | 15 | // [assembly: AssemblyVersion("1.0.*")] 16 | [assembly: AssemblyVersion("1.0.0.0")] 17 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Core.Tests.Unit/TestData/CrmEntity.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Core.Tests.Unit/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.CrmStore.Tests.Unit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("Capgemini.Xrm.DataMigration.CrmStore.Test.Unit")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("")] 8 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.CrmStore.Test.Unit")] 9 | [assembly: AssemblyCopyright("Copyright © 2019")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | [assembly: ComVisible(false)] 13 | [assembly: Guid("c12ccfc0-23a1-43bc-837e-b81cdacc7a8b")] 14 | 15 | // [assembly: AssemblyVersion("1.0.*")] 16 | [assembly: AssemblyVersion("1.0.0.0")] 17 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.CrmStore.Tests.Unit/TestData/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExcludedFields": [ 3 | "systemuserid", 4 | "roleid", 5 | "teamid", 6 | "fieldsecurityprofileid", 7 | "systemuserprofilesid", 8 | "systemuserrolesid", 9 | "teammembershipid", 10 | "businessunitid" 11 | ], 12 | "CrmMigrationToolSchemaPaths": [ 13 | "usersettingsschema.xml" 14 | ], 15 | "PageSize": 500, 16 | "BatchSize": 500, 17 | "TopCount": 100000, 18 | "OnlyActiveRecords": false, 19 | "JsonFolderPath": "TestData", 20 | "OneEntityPerBatch": true, 21 | "FilePrefix": "ExportedData", 22 | "SeperateFilesPerEntity": true, 23 | "LookupMapping": { 24 | "systemuser": { 25 | "businessunitid": [ 26 | "name" 27 | ] 28 | }, 29 | "systemuserroles": { 30 | "systemuserid": [ 31 | "domainname" 32 | ], 33 | "roleid": [ 34 | "name", 35 | "businessunitid" 36 | ] 37 | }, 38 | "teammembership": { 39 | "systemuserid": [ 40 | "domainname" 41 | ], 42 | "teamid": [ 43 | "name", 44 | "businessunitid" 45 | ] 46 | }, 47 | "systemuserprofiles": { 48 | "systemuserid": [ 49 | "domainname" 50 | ], 51 | "fieldsecurityprofileid": [ 52 | "name" 53 | ] 54 | }, 55 | "usersettings": { 56 | "systemuserid": [ 57 | "domainname" 58 | ] 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.CrmStore.Tests.Unit/TestData/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExcludedFields": [ 3 | "systemuserid", 4 | "roleid", 5 | "teamid", 6 | "fieldsecurityprofileid", 7 | "systemuserprofilesid", 8 | "systemuserrolesid", 9 | "teammembershipid", 10 | "businessunitid" 11 | ], 12 | "CrmMigrationToolSchemaPaths": [ 13 | "TestData\\usersettingsschema.xml" 14 | ], 15 | "PageSize": 500, 16 | "BatchSize": 500, 17 | "TopCount": 100000, 18 | "OnlyActiveRecords": false, 19 | "JsonFolderPath": "TestData", 20 | "OneEntityPerBatch": true, 21 | "FilePrefix": "ExportedData", 22 | "SeperateFilesPerEntity": true, 23 | "LookupMapping": { 24 | "systemuser": { 25 | "businessunitid": [ 26 | "name" 27 | ] 28 | }, 29 | "systemuserroles": { 30 | "systemuserid": [ 31 | "domainname" 32 | ], 33 | "roleid": [ 34 | "name", 35 | "businessunitid" 36 | ] 37 | }, 38 | "teammembership": { 39 | "systemuserid": [ 40 | "domainname" 41 | ], 42 | "teamid": [ 43 | "name", 44 | "businessunitid" 45 | ] 46 | }, 47 | "systemuserprofiles": { 48 | "systemuserid": [ 49 | "domainname" 50 | ], 51 | "fieldsecurityprofileid": [ 52 | "name" 53 | ] 54 | }, 55 | "usersettings": { 56 | "systemuserid": [ 57 | "domainname" 58 | ] 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.CrmStore.Tests.Unit/TestData/ImportSchemas/BusinessUnitSchema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.CrmStore.Tests.Unit/TestData/ImportSchemas/TestDataSchema/testschemafile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.CrmStore.Tests.Unit/TestData/PostDeployDataImport.json: -------------------------------------------------------------------------------- 1 | { 2 | "IgnoreStatuses": false, 3 | "IgnoreSystemFields": true, 4 | "MigrationConfig": { 5 | "ApplyAliasMapping": true, 6 | "SourceRootBUName": "superdevelop", 7 | "Mappings": {} 8 | }, 9 | "SaveBatchSize": 200, 10 | "JsonFolderPath": "Extract", 11 | "DeactivateAllProcesses": false, 12 | "FilePrefix": "DS0.1", 13 | "EntitiesToSync": [ 14 | "ds_visittype" 15 | ], 16 | "PassOneReferences": [ 17 | "businessunit", 18 | "subject", 19 | "routingrule", 20 | "queue", 21 | "sla", 22 | "uom", 23 | "uomschedule", 24 | "product", 25 | "pricelevel" 26 | ], 27 | "ObjectTypeCodeMappingConfig": { 28 | "EntityToTypeCodeMapping": { 29 | "ds_requesttovest": 10113 30 | }, 31 | "FieldsToSearchForMapping": [ 32 | "primaryentityotc" 33 | ] 34 | }, 35 | "NoUpdateEntities": [ 36 | "ds_configurationparameter" 37 | ] 38 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.CrmStore.Tests.Unit/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Engine.Tests.Unit/Implementation/CrmRetryExecutorTest.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using Capgemini.DataMigration.Resiliency; 3 | using Capgemini.DataMigration.Resiliency.Polly; 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | 6 | namespace Capgemini.Xrm.DataMigration.Engine.Tests.Unit.Implementation 7 | { 8 | [ExcludeFromCodeCoverage] 9 | [TestClass] 10 | public class CrmRetryExecutorTest 11 | { 12 | private ServiceRetryExecutor executor; 13 | 14 | [TestMethod] 15 | public void CanExecuteFirstAttempt() 16 | { 17 | var p = new PollyFluentPolicy(); 18 | 19 | executor = new ServiceRetryExecutor(p); 20 | var res = executor.Execute(() => { return 1 + 1; }); 21 | 22 | Assert.AreEqual(2, res); 23 | } 24 | 25 | [TestMethod] 26 | public void CrmRetryExecutorImplementsIPolicyBuilderInterface() 27 | { 28 | var p = new PollyFluentPolicy(); 29 | Assert.IsInstanceOfType(p, typeof(IPolicyBuilder)); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Engine.Tests.Unit/Implementation/TestCrmGenericImporter.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using Capgemini.DataMigration.Core; 3 | using Capgemini.Xrm.DataMigration.Config; 4 | using Capgemini.Xrm.DataMigration.CrmStore.DataStores; 5 | using Capgemini.Xrm.DataMigration.DataStore; 6 | using Microsoft.Xrm.Sdk; 7 | 8 | namespace Capgemini.Xrm.DataMigration.Engine.Tests.Unit.Implementation 9 | { 10 | [ExcludeFromCodeCoverage] 11 | public class TestCrmGenericImporter : CrmGenericImporter 12 | { 13 | public TestCrmGenericImporter( 14 | ILogger logger, 15 | IDataStoreReader storeReader, 16 | DataCrmStoreWriter storeWriter, 17 | ICrmGenericImporterConfig config) 18 | : base(logger, storeReader, storeWriter, config) 19 | { 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Engine.Tests.Unit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("Capgemini.Xrm.DataMigration.Engine.Tests.Unit")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("")] 8 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.Engine.Tests.Unit")] 9 | [assembly: AssemblyCopyright("Copyright © 2019")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | [assembly: ComVisible(false)] 13 | [assembly: Guid("fc634fd6-b3c6-4205-abdf-5fd3baeb2e69")] 14 | 15 | // [assembly: AssemblyVersion("1.0.*")] 16 | [assembly: AssemblyVersion("1.0.0.0")] 17 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Engine.Tests.Unit/TestData/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExcludedFields": [ 3 | "systemuserid", 4 | "roleid", 5 | "teamid", 6 | "fieldsecurityprofileid", 7 | "systemuserprofilesid", 8 | "systemuserrolesid", 9 | "teammembershipid", 10 | "businessunitid" 11 | ], 12 | "CrmMigrationToolSchemaPaths": [ 13 | "C:\\GitRepos\\UserSettings\\usersettingsschema.xml" 14 | ], 15 | "PageSize": 500, 16 | "BatchSize": 500, 17 | "TopCount": 100000, 18 | "OnlyActiveRecords": false, 19 | "JsonFolderPath": "C:\\GitRepos\\ExtractedData", 20 | "OneEntityPerBatch": true, 21 | "FilePrefix": "ExportedData", 22 | "SeperateFilesPerEntity": true, 23 | "LookupMapping": { 24 | "systemuser": { 25 | "businessunitid": [ 26 | "name" 27 | ] 28 | }, 29 | "systemuserroles": { 30 | "systemuserid": [ 31 | "domainname" 32 | ], 33 | "roleid": [ 34 | "name", 35 | "businessunitid" 36 | ] 37 | }, 38 | "teammembership": { 39 | "systemuserid": [ 40 | "domainname" 41 | ], 42 | "teamid": [ 43 | "name", 44 | "businessunitid" 45 | ] 46 | }, 47 | "systemuserprofiles": { 48 | "systemuserid": [ 49 | "domainname" 50 | ], 51 | "fieldsecurityprofileid": [ 52 | "name" 53 | ] 54 | }, 55 | "usersettings": { 56 | "systemuserid": [ 57 | "domainname" 58 | ] 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Engine.Tests.Unit/TestData/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExcludedFields": [ 3 | "systemuserid", 4 | "roleid", 5 | "teamid", 6 | "fieldsecurityprofileid", 7 | "systemuserprofilesid", 8 | "systemuserrolesid", 9 | "teammembershipid", 10 | "businessunitid" 11 | ], 12 | "CrmMigrationToolSchemaPaths": [ 13 | "C:\\GitRepos\\UserSettings\\usersettingsschema.xml" 14 | ], 15 | "PageSize": 500, 16 | "BatchSize": 500, 17 | "TopCount": 100000, 18 | "OnlyActiveRecords": false, 19 | "JsonFolderPath": "C:\\GitRepos\\ExtractedData", 20 | "OneEntityPerBatch": true, 21 | "FilePrefix": "ExportedData", 22 | "SeperateFilesPerEntity": true, 23 | "LookupMapping": { 24 | "systemuser": { 25 | "businessunitid": [ 26 | "name" 27 | ] 28 | }, 29 | "systemuserroles": { 30 | "systemuserid": [ 31 | "domainname" 32 | ], 33 | "roleid": [ 34 | "name", 35 | "businessunitid" 36 | ] 37 | }, 38 | "teammembership": { 39 | "systemuserid": [ 40 | "domainname" 41 | ], 42 | "teamid": [ 43 | "name", 44 | "businessunitid" 45 | ] 46 | }, 47 | "systemuserprofiles": { 48 | "systemuserid": [ 49 | "domainname" 50 | ], 51 | "fieldsecurityprofileid": [ 52 | "name" 53 | ] 54 | }, 55 | "usersettings": { 56 | "systemuserid": [ 57 | "domainname" 58 | ] 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Engine.Tests.Unit/TestData/LookupFiles/EmptyFolder/EmptyFile.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Engine.Tests.Unit/TestData/LookupFiles/ukpostcodes.csv: -------------------------------------------------------------------------------- 1 | id,postcode,latitude,longitude 2 | 384328,SE25 5EG,51.392184343497100,-0.089899032724418 3 | 431472,S66 1WH,53.420454000000000,-1.261540000000000 4 | 585960,PE11 2AR,52.788599020149500,-0.146748000000000 5 | 1051363,HR4 9NN,52.071662073756500,-2.738708350791900 6 | 1177031,FK2 0AZ,55.969561865837500,-3.694528396001650 7 | 1188642,EX32 0TA,51.063963149677900,-3.888865287899050 -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Engine.Tests.Unit/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.FileStore.Tests.Unit/Config/FileStoreReaderConfigTests.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using Capgemini.Xrm.DataMigration.FileStore.Config; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | 5 | namespace Capgemini.Xrm.DataMigration.FileStore.UnitTests.DataStore 6 | { 7 | [ExcludeFromCodeCoverage] 8 | [TestClass] 9 | public class FileStoreReaderConfigTests 10 | { 11 | private FileStoreReaderConfig systemUnderTest; 12 | 13 | [TestMethod] 14 | public void PropertiesInitializedToDefaultValues() 15 | { 16 | systemUnderTest = new FileStoreReaderConfig(); 17 | 18 | Assert.AreEqual("ExportedData", systemUnderTest.FilePrefix); 19 | Assert.IsNull(systemUnderTest.JsonFolderPath); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.FileStore.Tests.Unit/Config/FileStoreWriterConfigTests.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using Capgemini.Xrm.DataMigration.FileStore.Config; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | 5 | namespace Capgemini.Xrm.DataMigration.FileStore.UnitTests.DataStore 6 | { 7 | [ExcludeFromCodeCoverage] 8 | [TestClass] 9 | public class FileStoreWriterConfigTests 10 | { 11 | private FileStoreWriterConfig systemUnderTest; 12 | 13 | [TestMethod] 14 | public void PropertiesInitializedToDefaultValues() 15 | { 16 | systemUnderTest = new FileStoreWriterConfig(); 17 | 18 | Assert.IsTrue(systemUnderTest.SeperateFilesPerEntity); 19 | Assert.IsTrue(systemUnderTest.ExcludedFields.Count == 0); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.FileStore.Tests.Unit/Core/TestBase.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.IO; 3 | using System.Reflection; 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | 6 | namespace Capgemini.Xrm.DataMigration.FileStore.UnitTests 7 | { 8 | [ExcludeFromCodeCoverage] 9 | [TestClass] 10 | public abstract class TestBase 11 | { 12 | public const string AutomatedTestCategory = "AutomatedTest"; 13 | 14 | public TestContext TestContext { get; set; } 15 | 16 | public static string GetWorkiongFolderPath() 17 | { 18 | string folderPath = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName; 19 | return folderPath; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.FileStore.Tests.Unit/Model/CrmAttributeStoreTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics.CodeAnalysis; 4 | using FluentAssertions; 5 | using Microsoft.VisualStudio.TestTools.UnitTesting; 6 | 7 | namespace Capgemini.Xrm.DataMigration.FileStore.Model.Tests 8 | { 9 | [ExcludeFromCodeCoverage] 10 | [TestClass] 11 | public class CrmAttributeStoreTests 12 | { 13 | private CrmAttributeStore systemUnderTest; 14 | 15 | [TestMethod] 16 | public void CrmAttributeStore() 17 | { 18 | FluentActions.Invoking(() => systemUnderTest = new CrmAttributeStore()) 19 | .Should() 20 | .NotThrow(); 21 | 22 | Assert.IsNull(systemUnderTest.AttributeName); 23 | Assert.IsNull(systemUnderTest.AttributeValue); 24 | Assert.IsNull(systemUnderTest.AttributeType); 25 | } 26 | 27 | [TestMethod] 28 | public void CrmAttributeStoreWithParameter() 29 | { 30 | var attribute = new KeyValuePair("contactid", Guid.NewGuid()); 31 | 32 | FluentActions.Invoking(() => systemUnderTest = new CrmAttributeStore(attribute)) 33 | .Should() 34 | .NotThrow(); 35 | 36 | Assert.AreEqual(attribute.Key, systemUnderTest.AttributeName); 37 | Assert.AreEqual(attribute.Value.ToString(), systemUnderTest.AttributeValue.ToString()); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.FileStore.Tests.Unit/Model/CrmExportedDataStoreTests.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using FluentAssertions; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | 5 | namespace Capgemini.Xrm.DataMigration.FileStore.Model.Tests 6 | { 7 | [ExcludeFromCodeCoverage] 8 | [TestClass] 9 | public class CrmExportedDataStoreTests 10 | { 11 | [TestMethod] 12 | public void CrmExportedDataStore() 13 | { 14 | CrmExportedDataStore systemUnderTest = null; 15 | 16 | FluentActions.Invoking(() => systemUnderTest = new CrmExportedDataStore()) 17 | .Should() 18 | .NotThrow(); 19 | 20 | Assert.IsTrue(systemUnderTest.ExportedEntities.Count == 0); 21 | Assert.IsTrue(systemUnderTest.RecordsCount == 0); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.FileStore.Tests.Unit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("Capgemini.Xrm.DataMigration.FileStore.Tests.Unit")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("")] 8 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.FileStore.Tests.Unit")] 9 | [assembly: AssemblyCopyright("Copyright © 2019")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | [assembly: ComVisible(false)] 13 | [assembly: Guid("e3f232aa-fdbc-4716-a233-87db51608ed8")] 14 | 15 | // [assembly: AssemblyVersion("1.0.*")] 16 | [assembly: AssemblyVersion("1.0.0.0")] 17 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.FileStore.Tests.Unit/TestData/ExtractedData/ErrorFilePrefix_contact_1.csv: -------------------------------------------------------------------------------- 1 | contactid,firstname,lastname,ownerid 2 | 274589c3-2dbf-465b-938a-4992a24fea5b,"First Test 1","Last Test 1",5633ab67-20f8-4f2b-8237-f81814910707 3 | e6f72b28-c9c8-4315-b005-7fbe74495e3b,"First Test 2","Last Test 2",fb73d6ab-86b1-4d59-a99b-b65792a0dc75 4 | 4ac0c3be-a142-402f-988b-0c01c158c065,"First Test 3","Last Test 3",91f9d682-e7aa-4506-bd8c-5f4c7f515044 5 | 07843cd6-ce3f-4638-a36f-5d7dbe4a5c26,"First Test 4","Last Test 4",925f0d29-8099-4247-a0c9-149dc9cf4c6b -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.FileStore.Tests.Unit/TestData/ExtractedData/ExportedDataUserProfile_systemuserprofiles_1.csv: -------------------------------------------------------------------------------- 1 | map.systemuserid.systemuser.domainname,map.fieldsecurityprofileid.fieldsecurityprofile.name 2 | Ben.Hosking@capgeminicrmuk.onmicrosoft.com,System Administrator 3 | joao.zorro_capgemini.com#EXT#@capgeminicrmuk.onmicrosoft.com,System Administrator 4 | dbf2f63332554437983fdfce4414f47ekkarampudi@capgeminicrmuk.onmicrosoft.com,System Administrator 5 | mewing@capgeminicrmuk.onmicrosoft.com,System Administrator 6 | lbenting@capgeminicrmuk.onmicrosoft.com,System Administrator 7 | oleksandr.krasnoshchok@capgeminicrmuk.onmicrosoft.com,System Administrator 8 | ksulikowski@capgeminicrmuk.onmicrosoft.com,System Administrator 9 | satya.kar@capgeminicrmuk.onmicrosoft.com,System Administrator 10 | ciauth@capgeminicrmuk.onmicrosoft.com,System Administrator 11 | mark.cunningham@capgeminicrmuk.onmicrosoft.com,System Administrator 12 | crmoln2@microsoft.com,System Administrator 13 | kriss.sulikowski@capgeminicrmuk.onmicrosoft.com,System Administrator 14 | joao.zorro@capgeminicrmuk.onmicrosoft.com,System Administrator 15 | Dmitriy.Kraevoy@capgeminicrmuk.onmicrosoft.com,System Administrator 16 | liam.charlesworth-dakin@capgeminicrmuk.onmicrosoft.com,System Administrator 17 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.FileStore.Tests.Unit/TestData/ExtractedData/ValidFilePrefix_contact_1.csv: -------------------------------------------------------------------------------- 1 | contactid,firstname,lastname,ownerid,ownerid.LogicalName 2 | 274589c3-2dbf-465b-938a-4992a24fea5b,"First Test 1","Last Test 1",5633ab67-20f8-4f2b-8237-f81814910707,"systemuser" 3 | e6f72b28-c9c8-4315-b005-7fbe74495e3b,"First Test 2","Last Test 2",fb73d6ab-86b1-4d59-a99b-b65792a0dc75,"systemuser" 4 | 4ac0c3be-a142-402f-988b-0c01c158c065,"First Test 3","Last Test 3",91f9d682-e7aa-4506-bd8c-5f4c7f515044,"team" 5 | 07843cd6-ce3f-4638-a36f-5d7dbe4a5c26,"First Test 4","Last Test 4",925f0d29-8099-4247-a0c9-149dc9cf4c6b,"user" -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.FileStore.Tests.Unit/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/DataMigration/DataStoreTests/DataFileStoreReaderWriterTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using Capgemini.DataMigration.Core; 6 | using Capgemini.Xrm.DataMigration.DataStore; 7 | using Capgemini.Xrm.DataMigration.FileStore.DataStore; 8 | using FluentAssertions; 9 | using Microsoft.VisualStudio.TestTools.UnitTesting; 10 | 11 | namespace Capgemini.Xrm.DataMigration.IntegrationTests 12 | { 13 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 14 | [TestClass] 15 | public class DataFileStoreReaderWriterTest 16 | { 17 | [TestMethod] 18 | public void SaveBatchDataToStore() 19 | { 20 | DataFileStoreWriter mgr = new DataFileStoreWriter(new ConsoleLogger(), $"{DateTime.UtcNow.ToString("yyMMmmss", CultureInfo.InvariantCulture)}testexport", "TestData"); 21 | 22 | FluentActions.Invoking(() => mgr.SaveBatchDataToStore(EntityMockHelper.EntitiesToCreate.Select(p => new EntityWrapper(p)).ToList())) 23 | .Should() 24 | .NotThrow(); 25 | } 26 | 27 | [TestMethod] 28 | public void ReadBatchDataFromStore() 29 | { 30 | DataFileStoreReader mgr = new DataFileStoreReader(new ConsoleLogger(), "testexport", @"TestData"); 31 | List result = mgr.ReadBatchDataFromStore(); 32 | 33 | Assert.IsTrue(result.Count > 0); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/DataMigration/EntityMetadataCacheTest.cs: -------------------------------------------------------------------------------- 1 | using Capgemini.Xrm.DataMigration.Cache; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace Capgemini.Xrm.DataMigration.IntegrationTests.DataMigration 5 | { 6 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 7 | [TestClass] 8 | public class EntityMetadataCacheTest 9 | { 10 | [TestMethod] 11 | public void GetEntityMetadata() 12 | { 13 | var orgService = ConnectionHelper.GetOrganizationalServiceTarget(); 14 | var cache = new EntityMetadataCache(orgService); 15 | var contactCache = cache.GetEntityMetadata("contact"); 16 | 17 | // this time it shoudl get item from cache 18 | var cache2 = new EntityMetadataCache(orgService); 19 | var contactCache2 = cache2.GetEntityMetadata("contact"); 20 | 21 | Assert.AreSame(contactCache, contactCache2); 22 | Assert.AreEqual(contactCache.Keys.Length, contactCache2.Keys.Length); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/DataMigration/MigrationTests/CrmFileMigrationAppointmentsTest.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Capgemini.Xrm.DataMigration.IntegrationTests.DataMigration.MigrationTests 4 | { 5 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 6 | [TestClass] 7 | public class CrmFileMigrationAppointmentsTest : CrmFileMigrationBaseTest 8 | { 9 | public CrmFileMigrationAppointmentsTest() 10 | : base( 11 | "TestData\\ImportSchemas\\AppointmentsSchema", 12 | "apointmentsSchema.xml", 13 | "Appointments", 14 | ConnectionHelper.GetOrganizationalServiceSource(), 15 | ConnectionHelper.GetOrganizationalServiceTarget()) 16 | { 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/DataMigration/MigrationTests/CrmFileMigrationCrmPortalsTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Capgemini.Xrm.DataMigration.CrmStore.Config; 3 | using Capgemini.Xrm.DataMigration.IntegrationTests.DataMigration.MigrationTests; 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | 6 | namespace Capgemini.Xrm.DataMigration.IntegrationTests 7 | { 8 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 9 | [TestClass] 10 | public class CrmFileMigrationCrmPortalsTests : CrmFileMigrationBaseTest 11 | { 12 | public CrmFileMigrationCrmPortalsTests() 13 | : base( 14 | "TestData\\ImportSchemas\\CrmPortal", 15 | "CrmPortalFullSchemaWithNotes.xml", 16 | "CrmPortalsData", 17 | ConnectionHelper.GetOrganizationalServicePortalSource(), 18 | ConnectionHelper.GetOrganizationalServicePortalTarget()) 19 | { 20 | } 21 | 22 | protected override CrmImportConfig GetImporterConfig() 23 | { 24 | var importConfig = base.GetImporterConfig(); 25 | 26 | importConfig.EntitiesToSync.AddRange(new List() { "adx_weblink", "adx_webpage" }); 27 | 28 | return importConfig; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/DataMigration/MigrationTests/CrmFileMigrationMarketingListTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Capgemini.Xrm.DataMigration.CrmStore.Config; 3 | using Capgemini.Xrm.DataMigration.IntegrationTests.DataMigration.MigrationTests; 4 | using Microsoft.VisualStudio.TestTools.UnitTesting; 5 | 6 | namespace Capgemini.Xrm.DataMigration.IntegrationTests 7 | { 8 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 9 | [TestClass] 10 | public class CrmFileMigrationMarketingListTests : CrmFileMigrationBaseTest 11 | { 12 | public CrmFileMigrationMarketingListTests() 13 | : base( 14 | "TestData\\ImportSchemas\\MarketingList", 15 | "MarketingListDataSchema.xml", 16 | "MarketingList", 17 | ConnectionHelper.GetOrganizationalServiceSource(), 18 | ConnectionHelper.GetOrganizationalServiceTarget()) 19 | { 20 | } 21 | 22 | protected override CrmImportConfig GetImporterConfig() 23 | { 24 | var importConfig = base.GetImporterConfig(); 25 | importConfig.NoUpsertEntities.AddRange(new List() { "list" }); 26 | return importConfig; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/DataMigration/MigrationTests/CrmFileMigrationMultiOptionSetTests.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | 3 | namespace Capgemini.Xrm.DataMigration.IntegrationTests.DataMigration.MigrationTests 4 | { 5 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 6 | [TestClass] 7 | public class CrmFileMigrationMultiOptionSetTests : CrmFileMigrationBaseTest 8 | { 9 | public CrmFileMigrationMultiOptionSetTests() 10 | : base( 11 | "TestData\\ImportSchemas\\MultiOptionSet", 12 | "multioptionsetschema.xml", 13 | "multiselect", 14 | ConnectionHelper.GetOrganizationalServiceSource(), 15 | ConnectionHelper.GetOrganizationalServiceTarget(), 16 | true) 17 | { 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/Helpers/FileManager.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace Capgemini.Xrm.DataMigration.Tests.Integration.Helpers 4 | { 5 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 6 | public static class FileManager 7 | { 8 | public static void DeleteAllContentsFromFolder(string path) 9 | { 10 | if (Directory.Exists(path)) 11 | { 12 | var files = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories); 13 | foreach (var item in files) 14 | { 15 | DeleteFile(item); 16 | } 17 | } 18 | } 19 | 20 | public static void DeleteFile(string file) 21 | { 22 | if (File.Exists(file)) 23 | { 24 | File.Delete(file); 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("Capgemini.Xrm.DataMigration.Tests.Integration")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("")] 8 | [assembly: AssemblyProduct("Capgemini.Xrm.DataMigration.Tests.Integration")] 9 | [assembly: AssemblyCopyright("Copyright © 2019")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: AssemblyCulture("")] 12 | [assembly: ComVisible(false)] 13 | [assembly: Guid("42785abf-1469-4788-bf62-d3e14264f5f7")] 14 | 15 | // [assembly: AssemblyVersion("1.0.*")] 16 | [assembly: AssemblyVersion("1.0.0.0")] 17 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/SerializationTests/SchemaFileTest.cs: -------------------------------------------------------------------------------- 1 | using Capgemini.Xrm.DataMigration.Config; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace Capgemini.Xrm.DataMigration.IntegrationTests.SerializationTests 5 | { 6 | [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 7 | [TestClass] 8 | public class SchemaFileTest 9 | { 10 | [TestMethod] 11 | public void ReadSchemaFromFile() 12 | { 13 | var schema = CrmSchemaConfiguration.ReadFromFile("TestData/usersettingsschema.xml"); 14 | 15 | Assert.IsNotNull(schema); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ExportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExcludedFields": [ 3 | "systemuserid", 4 | "roleid", 5 | "teamid", 6 | "fieldsecurityprofileid", 7 | "systemuserprofilesid", 8 | "systemuserrolesid", 9 | "teammembershipid", 10 | "businessunitid" 11 | ], 12 | "CrmMigrationToolSchemaPaths": [ 13 | "C:\\GitRepos\\UserSettings\\usersettingsschema.xml" 14 | ], 15 | "PageSize": 500, 16 | "BatchSize": 500, 17 | "TopCount": 100000, 18 | "OnlyActiveRecords": false, 19 | "JsonFolderPath": "C:\\GitRepos\\ExtractedData", 20 | "OneEntityPerBatch": true, 21 | "FilePrefix": "ExportedData", 22 | "SeperateFilesPerEntity": true, 23 | "LookupMapping": { 24 | "systemuser": { 25 | "businessunitid": [ 26 | "name" 27 | ] 28 | }, 29 | "systemuserroles": { 30 | "systemuserid": [ 31 | "domainname" 32 | ], 33 | "roleid": [ 34 | "name", 35 | "businessunitid" 36 | ] 37 | }, 38 | "teammembership": { 39 | "systemuserid": [ 40 | "domainname" 41 | ], 42 | "teamid": [ 43 | "name", 44 | "businessunitid" 45 | ] 46 | }, 47 | "systemuserprofiles": { 48 | "systemuserid": [ 49 | "domainname" 50 | ], 51 | "fieldsecurityprofileid": [ 52 | "name" 53 | ] 54 | }, 55 | "usersettings": { 56 | "systemuserid": [ 57 | "domainname" 58 | ] 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ExtractedData/ExportedDataUserProfile_systemuserprofiles_1.csv: -------------------------------------------------------------------------------- 1 | map.systemuserid.systemuser.domainname,map.fieldsecurityprofileid.fieldsecurityprofile.name 2 | Ben.Hosking@capgeminicrmuk.onmicrosoft.com,System Administrator 3 | joao.zorro_capgemini.com#EXT#@capgeminicrmuk.onmicrosoft.com,System Administrator 4 | dbf2f63332554437983fdfce4414f47ekkarampudi@capgeminicrmuk.onmicrosoft.com,System Administrator 5 | mewing@capgeminicrmuk.onmicrosoft.com,System Administrator 6 | lbenting@capgeminicrmuk.onmicrosoft.com,System Administrator 7 | oleksandr.krasnoshchok@capgeminicrmuk.onmicrosoft.com,System Administrator 8 | ksulikowski@capgeminicrmuk.onmicrosoft.com,System Administrator 9 | satya.kar@capgeminicrmuk.onmicrosoft.com,System Administrator 10 | ciauth@capgeminicrmuk.onmicrosoft.com,System Administrator 11 | mark.cunningham@capgeminicrmuk.onmicrosoft.com,System Administrator 12 | crmoln2@microsoft.com,System Administrator 13 | kriss.sulikowski@capgeminicrmuk.onmicrosoft.com,System Administrator 14 | joao.zorro@capgeminicrmuk.onmicrosoft.com,System Administrator 15 | Dmitriy.Kraevoy@capgeminicrmuk.onmicrosoft.com,System Administrator 16 | liam.charlesworth-dakin@capgeminicrmuk.onmicrosoft.com,System Administrator 17 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/FetchXmlFolder/contact.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ImportConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExcludedFields": [ 3 | "systemuserid", 4 | "roleid", 5 | "teamid", 6 | "fieldsecurityprofileid", 7 | "systemuserprofilesid", 8 | "systemuserrolesid", 9 | "teammembershipid", 10 | "businessunitid" 11 | ], 12 | "CrmMigrationToolSchemaPaths": [ 13 | "TestData\\usersettingsschema.xml" 14 | ], 15 | "PageSize": 500, 16 | "BatchSize": 500, 17 | "TopCount": 100000, 18 | "OnlyActiveRecords": false, 19 | "JsonFolderPath": "ExtractedData", 20 | "OneEntityPerBatch": true, 21 | "FilePrefix": "ExportedData", 22 | "SeperateFilesPerEntity": true, 23 | "LookupMapping": { 24 | "systemuser": { 25 | "businessunitid": [ 26 | "name" 27 | ] 28 | }, 29 | "systemuserroles": { 30 | "systemuserid": [ 31 | "domainname" 32 | ], 33 | "roleid": [ 34 | "name", 35 | "businessunitid" 36 | ] 37 | }, 38 | "teammembership": { 39 | "systemuserid": [ 40 | "domainname" 41 | ], 42 | "teamid": [ 43 | "name", 44 | "businessunitid" 45 | ] 46 | }, 47 | "systemuserprofiles": { 48 | "systemuserid": [ 49 | "domainname" 50 | ], 51 | "fieldsecurityprofileid": [ 52 | "name" 53 | ] 54 | }, 55 | "usersettings": { 56 | "systemuserid": [ 57 | "domainname" 58 | ] 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ImportSchemas/BusinessUnits/BusinessUnitSchema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ImportSchemas/CallendarSettings/callendarSchema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ImportSchemas/ContactSchema/ContactSchemaWithOwner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ImportSchemas/CustomSolutionSchema/DataTest_1_0_0_0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Capgemini/xrm-datamigration/7f06fd1456e1da79de24083e20a29fdc88e61b77/tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ImportSchemas/CustomSolutionSchema/DataTest_1_0_0_0.zip -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ImportSchemas/MultiOptionSet/multioptionsetschema.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ImportSchemas/RolesTeamsRelationship/teamsrolesschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ImportSchemas/ServiceEndpoint/serviceendpointschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/ImportSchemas/TestDataSchema/testschemafile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/TestData/testschemafile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/Capgemini.Xrm.DataMigration.Tests.Integration/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | --------------------------------------------------------------------------------