Custom migration behavior

Overview

You can extend the SiteSync module to implement custom migration behavior. This happens with the help of the ICustomMigrationBehavior interface, which provides extensibility point for the SiteSync migration operation.
Once you implement the interface, you need to register your instance in the ObjectFactory.
The same implementation should be used on the source and target servers.

Procedure

  1. Implement the ICustomMigrationBehavior interface.
    There are three main points where you can plug and intervene in the migration process using this interface:
    • Using ProcessItemExport method - where you can modify the WrapperObject that will be sent to the destination
    • Using ProcessItemImport method - where you validate the migration operation on the target and process the imported data
    • Using HandleMigrationCompleted method - Handles the logic on the target server after the migration process completes

    You can also use the SkipLoadingDependencies property - a value indicating whether implicitly syncing item dependencies should be skipped. You can set that to true, if you will migrate all items at once and the dependencies calculation will only slow things down.
    You can see the sample below for an example of implementation.

  2. Register the custom items in the Global.asax class.

  3. You can see the sample below for an example on how to register your instance.


Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?