Recover a failed import
If an import fails, entities with dependencies (for example, Portal.PageComponent and Portal.PageDefinition) are automatically rolled back to their previous state. Other changes from the import are not automatically reverted. To undo those changes, restore your environment using a recovery package.
You can use the recovery package generated during the failed import to restore your environment using the Sitecore Content Hub CLI or you can download the recovery package using the Entities API.
Recover a failed import using the CLI
To recover a failed import using the CLI:
-
Find the job ID using one of the following methods:
-
In the UI, find the job ID either on the Recent processes page or the Background processes page.
-
In the CLI, run the following command:
-
-
Get the backup order ID for the failed import:
-
Download the recovery package for that backup order:
-
Restore the tenant using the recovery package:
-
Verify that the recovery process has completed successfully:
Recover a failed import using the Entities API
To recover a failed import using the Entities API:
-
In Sitecore Content Hub, go to the Background processes page and find the failed job import.
-
Next to the failed job import, click View report, and copy the
backup_order_id. -
Use the Entities API to retrieve the recovery package with the
backup_order_id. -
In the returned JSON payload, scroll to the renditions section and locate the
downloadOrder. -
Copy the URL from the
hrefattribute and paste it into your browser to download the backup package.zipfile. -
Import the package into your environment.
Best practices
Follow these best practices to ensure a safe and successful recovery:
- Review error messages in the simulation summary report before proceeding.
- Always use the correct CLI context and ensure you have the necessary permissions.
- Do not skip steps—restoring from an incorrect package or skipping the recovery import can worsen tenant issues.
- Monitor the import job until it completes to ensure successful recovery.