1. General best practices

Importing and exporting data

This section lists the best practices recommended to optimize importing, exporting, or migrating your data within Sitecore Content Hub.

Import and export Content Hub data

Full system migration

  • When migrating from a previous assets management system to Content Hub, make sure to lock assets for edit or mark them as migrated. The migration takes time, and any changes made to the source environment after migration begins will not be carried over to the destination. After the migration, update your assets only in Content Hub.
  • Migrate the data outside business hours, to avoid slowing down the application. However, the Excel import priority is lower than UI operations, so users should not see delays in file preview generations or bulk download orders, even if you perform the data migration during business hours.
  • When importing portal pages, some or all pages might return a 403 or 404 error.

Importing or exporting packages

  • Always have one source environment and one target environment. Complete a full export from the source environment and import the entire package to the target environment.
  • To prevent conflicts resulting from mismatched identifiers, avoid manually creating entities in the target environment that duplicate those in the source environment.
  • If you need to make changes to the source environment, make them before creating the export package, to avoid having to export again afterwards.
  • Check the files you want to migrate and their renditions. Large image formats, like TIF or PSD, can be difficult to render with the default 8GB memory media processing agents.

Importing or exporting Excel data

  • Add a batchID property to your entity definition and a corresponding column in the Excel file, to easily retrieve the batch and delete the related item if necessary.
  • The maximum number of items in a selection is 2,000. If any Excel file you want to import has more than this, split it into smaller files containing no more than 2,000 rows each.
  • Ensure import settings are set to rawImport to bypass triggers logic and reduce data processing time. To avoid issues with mass edit in table operations, turn off the rawImport flag when the import finishes.
  • For taxonomies, you can disable the Triggers extract archive setting for asset types whose subfiles you don't need to extract. Archive files can be large, and extracting their subfiles increases the load on media processing.
  • When importing data, we recommend you clear the Extract content check box on the Parameters tab for the processing task to avoid impacting performance.

Import and export configuration data

  • When you export portal pages, make sure to include publish definition configurations, entity definitions, and taxonomies. Avoid exporting portal pages referencing entity definitions that are not exported.
  • When you import or export changes to entity definitions, make sure to include:
    • Export profiles, if modified.
    • Portal pages.
    • Publish definition configurations.
    • Taxonomies. If you've added new taxonomy definitions, make sure to also export taxonomies with existing values.
    • Policies, including security policies and referenced entity definitions or taxonomies. For example, you might want a user group to access all assets linked to ProductLineToAsset that have the value of X.
Warning

Importing a lot of entity definitions that require reindexing might cause a large number of graph messages.

Import and export state flows

When you export state flows, make sure to include:

  • Entity definitions - if state flows are enabled for a definition, also export that definition.
  • Publish definition configurations - always export together with entity definitions.
  • Portal pages - state flow actions are usually added when a new state flow is added.
  • Policies - policies and User-to-User-group assignments are usually updated when a state flow is defined. Be sure to include all taxonomies that are referenced by the policies.
  • Triggers - triggers are usually required to initiate a state flow only when a condition is met. Always include the trigger conditions and all scripts linked to the triggers.
Note

If you have state flows with active triggers in the target environment, be aware that these triggers will activate during package imports if certain conditions are met. For instance, if you have a trigger set up for newly created or updated asset types, and your package includes a new asset type, that trigger will run when the package is imported.

Migrate option list to taxonomy

To migrate an option list to a taxonomy:

  1. Create a taxonomy and add values.

    Important

    Don't rename the automatically generated identifier. Instead, keep DefinitionName.TaxonomyName as the identifier for each taxonomy value.

  2. Create a relation between the taxonomy and your target entity definition.

  3. Export the resulting entities to Excel, making sure to include the option list property and the new relation.

  4. Ensure your target environment uses the same option list values. Then, use the API to share the taxonomy values and details on how to create relations in your target environment.

  5. If you need to secure your entities based on this new taxonomy, review and update the user groups and their policies.

  6. Update the portal pages and their components to add the new taxonomy value. For example, you need to remove the option list value from the advanced search feature of the Search component, and you might need to add taxonomy as a filter.

  7. Open the exported Excel file and add the identifiers of the new taxonomy values to your entities, then remove the option list values.

  8. Import the Excel file.

  9. To validate the mass edit operation, query the entities with the option list values to check that no entities are linked to them.

  10. Remove all properties that reference this option list from the applicable entity definitions.

  11. Delete the option list and its values.

Migrate taxonomy to option list

To migrate a taxonomy to an option list:

  1. Create an option list.
  2. Create the option list member in your target entity definition.
  3. Export your entities to Excel, making sure to include the new option list and the new taxonomy relation in the export profile.
  4. Ensure your target environment uses the same taxonomy values. Then, use the API to share the option list values and details on how to create relations in your target environment.
  5. If the security rules are using the taxonomy definition, review the applicable user groups and user group policies to delete all referrals.
  6. Update the portal page components to add the option list values. For example, you might need to add the option list to the Search component as a facet, or display it in the output.
  7. Open the exported Excel file and the add new option list values to your entities, then remove the taxonomy values.
  8. Import the Excel data in batches containing no more than 2,000 rows each.
  9. Delete the taxonomy and its values.
If you have suggestions for improving this article, let us know!