Skip to content

Commit

Permalink
Fix (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksulikow authored Apr 9, 2019
1 parent 37cba7b commit 6d44149
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
</runtime>
<applicationSettings>
<Capgemini.Xrm.Datamigration.Examples.Properties.Settings>
<setting name="DemoScenarioName" serializeAs="String">
<value>Contacts</value>
</setting>
<setting name="CrmExportConnectionString" serializeAs="String">
<value>Url = CRMUrl; Username=user; Password=password; AuthType=Office365; RequireNewInstance=True;</value>
</setting>
<setting name="CrmImportConnectionString" serializeAs="String">
<value>Url = CRMUrl; Username=user; Password=password; AuthType=Office365; RequireNewInstance=True;</value>
</setting>
<setting name="DemoScenarioName" serializeAs="String">
<value>Contacts</value>
<setting name="UseCsvImport" serializeAs="String">
<value>False</value>
</setting>
</Capgemini.Xrm.Datamigration.Examples.Properties.Settings>
</applicationSettings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,19 @@ static void ExportData(string connectionString, string schemaPath, string export
var entityRepo = new EntityRepository(serviceClient, new ServiceRetryExecutor());
var logger = new ConsoleLogger();

// Json Export
var fileExporterJson = new CrmFileDataExporter(logger, entityRepo, GetExportConfig(), tokenSource.Token);
fileExporterJson.MigrateData();

// Csv Export
var schema = CrmSchemaConfiguration.ReadFromFile(schemaPath);
var fileExporterCsv = new CrmFileDataExporterCsv(logger, entityRepo, GetExportConfig(), tokenSource.Token, schema);
fileExporterCsv.MigrateData();
if (!Settings.Default.UseCsvImport)
{
// Json Export
var fileExporterJson = new CrmFileDataExporter(logger, entityRepo, GetExportConfig(), tokenSource.Token);
fileExporterJson.MigrateData();
}
else
{
// Csv Export
var schema = CrmSchemaConfiguration.ReadFromFile(schemaPath);
var fileExporterCsv = new CrmFileDataExporterCsv(logger, entityRepo, GetExportConfig(), tokenSource.Token, schema);
fileExporterCsv.MigrateData();
}

Console.WriteLine("Export Finished");
}
Expand All @@ -73,14 +78,19 @@ public static void ImportData(string connectionString, string schemaPath, string
var entityRepo = new EntityRepository(serviceClient, new ServiceRetryExecutor());
var logger = new ConsoleLogger();

// Json Import
var fileImporterJson = new CrmFileDataImporter(logger, entityRepo, GetImportConfig(), tokenSource.Token);
fileImporterJson.MigrateData();

//Csv Import
var schema = CrmSchemaConfiguration.ReadFromFile(schemaPath);
var fileImporterCsv = new CrmFileDataImporterCsv(logger, entityRepo, GetImportConfig(), schema, tokenSource.Token);
fileImporterCsv.MigrateData();
if (!Settings.Default.UseCsvImport)
{
// Json Import
var fileImporterJson = new CrmFileDataImporter(logger, entityRepo, GetImportConfig(), tokenSource.Token);
fileImporterJson.MigrateData();
}
else
{
//Csv Import
var schema = CrmSchemaConfiguration.ReadFromFile(schemaPath);
var fileImporterCsv = new CrmFileDataImporterCsv(logger, entityRepo, GetImportConfig(), schema, tokenSource.Token);
fileImporterCsv.MigrateData();
}

Console.WriteLine("Import Finished");
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Capgemini.Xrm.Datamigration.Examples.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="DemoScenarioName" Type="System.String" Scope="Application">
<Value Profile="(Default)">Contacts</Value>
</Setting>
<Setting Name="CrmExportConnectionString" Type="System.String" Scope="Application">
<Value Profile="(Default)">Url = https://sourcerepo.dynamics.com; Username=xxxx; Password=xxxx; AuthType=Office365; RequireNewInstance=True;</Value>
<Value Profile="(Default)">Url = CRMUrl; Username=user; Password=password; AuthType=Office365; RequireNewInstance=True;</Value>
</Setting>
<Setting Name="CrmImportConnectionString" Type="System.String" Scope="Application">
<Value Profile="(Default)">Url = https://targetrepo.crm4.dynamics.com; Username=xxx; Password=xxxx; AuthType=Office365; RequireNewInstance=True;</Value>
<Value Profile="(Default)">Url = CRMUrl; Username=user; Password=password; AuthType=Office365; RequireNewInstance=True;</Value>
</Setting>
<Setting Name="DemoScenarioName" Type="System.String" Scope="Application">
<Value Profile="(Default)">Contacts</Value>
<Setting Name="UseCsvImport" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit 6d44149

Please sign in to comment.