Litium.Synchronization is a tool to move Customers and Orders from one Litium installation to another without dependency on Litium version.
This is useful during upgrades where the old installation can export all added information to the new environment as it is being added. At go live all traffic can be redirected to the new environment that already has all the data.
Litium.Synchronization is not a versioned addon, Litium does not maintain and upgrade the code for each new release of the platform. The code need to be tested before use in a production scenario.
Litium.Synchronization.Export.L5 has references to Litium 5.6.8 and Litium.Synchronization.Import has references to Litium 7.4.1.
Adjust if you upgrade is between other Litium versions (only versions specified above are tested)
-
Install nuget package references and compile the solution.
-
Add the following to appsettings of the web.config of the site that should be upgraded.
<add key=" SynchronizationExportFolder" value="Path to folder where exports will be added" />
-
Copy
Litium.Synchronization.Abstraction.dllandLitium.Synchronization.Export.L5.dllto the bin folder of the site to upgrade. Do not copy the config files. -
Clone your site upgrade the clone to litium the new Litium version.
-
Add the following to appsettings in web.config of your upgraded installation.
This configuration will add a prefix to orders and deliveries so that the orders that created in the upgraded version will not conflict with the orders that you are synchronizing.
<add key="SynchronizationImportFolder" value="Path to folder where exports are added" /> <add key="Litium:Sales:OrderNumberPrefix" value="Test" /> <add key="Litium:Sales:DeliveryNumberPrefix" value="TestD" />
-
Add the following validator to the upgraded Accelerator project so that persons created in the upgraded version will not conflict with the orders that are synchronized.
public class PersonIdValidator : ValidationRuleBase<Person> { public override ValidationResult Validate(Person entity, ValidationMode validationMode) { if (string.IsNullOrWhiteSpace(entity.Id)) { var id = Guid.NewGuid().ToString("N"); entity.Id = $"Test{id}" ; } return new ValidationResult(); } }
-
Add a similar validator for organziations
public class OrganizationIdValidator : ValidationRuleBase<Organization> { public override ValidationResult Validate(Organization entity, ValidationMode validationMode) { if (string.IsNullOrWhiteSpace(entity.Id)) { var id = Guid.NewGuid().ToString("N"); entity.Id = $"Test{id}" ; } return new ValidationResult(); } }
-
Add the following ScheduledJobs to web.config of the upgraded solution
<scheduledTask type="Litium.Synchronization.Import.Tasks.OrderImport, Litium.Synchronization.Import" startTime="00:00" interval="1m" parameters="MaxArchiveAgeInDays=7,MaxErrorAgeInMonths=1" /> <scheduledTask type="Litium.Synchronization.Import.Tasks.OrganizationImport, Litium.Synchronization.Import" startTime="00:00" interval="1m" parameters="MaxArchiveAgeInDays=7,MaxErrorAgeInMonths=1" /> <scheduledTask type="Litium.Synchronization.Import.Tasks.PersonImport, Litium.Synchronization.Import" startTime="00:00" interval="1m" parameters="MaxArchiveAgeInDays=7,MaxErrorAgeInMonths=1" />
-
Copy
Litium.Synchronization.Abstraction.dllandLitium.Synchronization.Import.dllto the upgraded solution
-
Ensure that all data has been imported to the new environment
-
Remove following appsettings before go live
<add key="Litium:Sales:OrderNumberPrefix" value="Test" /> <add key="Litium:Sales:DeliveryNumberPrefix" value="TestD" />
-
Remove the ValidationRules for persons and organizations from the solution