Migrate related data

  1. From the folder in which you cloned the Related data migration GitHub sample, copy the following files:
    • RelatedDataMigration.aspx
    • RelatedDataMigration.aspx.cs
    • RelatedDataMigration.aspx.designer.cs
  2. Paste the files in your Sitefinity CMS project folder.
  3. Open your project in Visual Studio.
  4. Include the above files in your solution and build it.
  5. Run the project.
  6. Create a new Related data field.
    For more information, see Add a related media custom field.
    Make sure that you are relating to the correct Data type and Source.
  7. Open page ~/RelatedDataMigration.aspx.
  8. Depending on the type of old field you used, from the Migration type dropdown menu, select one of the following:
    Old field
    Migration type
    New field prerequisite 
    Guid array
    Multiple Dynamic selector field (Guid array) In the Related data field designer,
    select the Multiple items from this data type can be related checkbox.
    Guid Single Dynamic selector field (Guid) In the Related data field designer,
    do not select the Multiple items from this data type can be related checkbox.
    Media Media field When creating a new Related media field, make sure you apply the same configuration as the one for the old Media field.
    NOTE: The old Media field supports data from multiple providers and the Related media field supports only one provider.
  9. Fill the form in the RelatedDataMigrationpage with the required data for the migration.
    For more information about parent and child relations, see What is related content.
    • ParentItemType - the dynamic content type containing the fields
    • ChildItemType - the related content type
    • ParentItemProviderName
    • ChildItemProviderName
    • The old selector or media field name
    • The name of the newly created Related data or Related media field
  10. Click Migrate data.
    The Migration log text area provides information about the migration process. For more detailed information about the status of the migration process, check the Migration.log file located in the \App_Data\Sitefinity\Logs folder. In case of an exception, check the Error.log file, located in the same folder.

    NOTE: Wait for the migration process to be completed before you attempt to access the items being migrated.

  11. Check manually whether field values of a few items are accurately migrated.

    NOTE: You need to refactor any frontend widgets that used the old fields and now need to use the new Related data and Related media fields.

  12. Delete the old selector or media field.

    After you have verified that the new fields contain the accurate migrated data, you can go to the structure of the dynamic module type and delete the old field. This deletes all old records and drops the old field table (in case you used Guid Array and media mappings).

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

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. 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?