For the complete documentation index, see llms.txt. This page is also available as Markdown.

Import and Export

How to import and export content and schema between Umbraco environments and projects

What Import and Export Is

The import and export feature of Umbraco Deploy allows you to transfer content and schema between Umbraco environments. A .zip file is exported from one environment and imported into another to update its Umbraco data.

When to use import and export

Umbraco Deploy provides two primary workflows for managing different types of Umbraco data:

It is recommended to use these approaches for day-to-day editorial and developer activities.

Import and export is intended more for larger transfer options, project upgrades, or one-off tasks when setting up new environments.

As import and export is a two-step process, it doesn't require inter-environment communication. This allows much larger batches of information to be processed without running into hard limits imposed by Cloud hosting platforms.

Hooks are also provided to allow for migrations of artifacts (such as data types) and property data when importing. This should allow you to migrate your Umbraco data from one Umbraco major version to a newer one.

Accessing import and export

Import and Export are actions on the Content section, available when you click the ... context menu:

  • On the Content root, the ... menu includes Import, Environment export, and Export.

  • On any individual content item (in the tree, or from within its workspace), the ... menu includes Export only.

Import and Export Icons

Exporting content and schema

To export content and schema, you can select either a specific item of content, a tree, workspace, or an environment.

Exporting a specific item or tree

Selecting Export on an individual content item opens the Export tree dialog. It lets you choose if you want to add any additional dependencies:

  • Include content dependencies (for example, related media and content)

  • Include content file dependencies (for example, media files)

  • Include schema dependencies (for example, document and data types)

  • Include schema file dependencies (for example, templates, scripts and stylesheets)

Tree export

Bear in mind that including content file dependencies (media files) for a large site can lead to a big zip file. So even with this option, you might want to consider a different method for transferring large amounts of media. For example using direct transfer between Cloud storage accounts or File Transfer Protocol (FTP).

If your account has access to the Settings section, you can also choose to include the schema information and related files as well.

Exporting an environment

Selecting Environment export from the Content root opens the Export environment dialog. All deployable items in the environment are selected by default, and you choose which categories to include:

  • Include all content (checked by default) and/or Include all schema

  • Include content dependencies (for example, related media and content)

  • Include content file dependencies (for example, media files)

  • Include schema dependencies (for example, document and data types)

  • Include schema file dependencies (for example, templates, scripts and stylesheets)

When exporting an environment, you can include all schema, regardless of whether any content uses it.

Environment export

Completing the export

Select Export to run it. Umbraco Deploy serializes all the selected items to individual files and archives them into a zip file. The Export complete dialog provides confirmation, with the export date and two actions:

  • Download export: downloads the zip file via the browser.

  • Delete export: removes the archive from the server immediately.

Export complete

If you miss doing this, you can also clean up archive files from the Umbraco Deploy dashboard in the Settings section.

Delete exports

The exported archive files are saved to the Umbraco temp folder in the Deploy\Export sub-directory. This is a temporary (non-persistent) location, local to the backoffice server and therefore shouldn't be used for long-term storage of exports. You can also only download the file from the export dialog in the backoffice.

If you close the dialog without deleting the archive, you can clean it up later. See Cleaning up export archives section below.

Importing content and schema

Having previously exported content and schema to a zip file, you can import this into a new environment. Select Import from the ... menu on the Content root.

Import (step 1)

You can upload the file via the browser. You can choose to import everything from the archive file, or only content, schema, or files.

Deploy does not touch the default maximum upload size, but you can configure this yourself by following the CMS documentation. On Umbraco Cloud, the upload size limit is 500 MB.

Import (step 2)

The file is validated before importing. Schema items that content depends on must either be in the upload itself or already exist on the target environment with the same details. If there are any issues that mean the import cannot proceed, it will be reported. You may also be given warnings for review. You can choose to ignore these and proceed if they aren't relevant to the action you are carrying out.

The import then proceeds, processing all the items provided in the zip file.

Import complete

Once complete or on close of the dialog, the imported file will be deleted from the server. If this is missed, perhaps via a closed browser, you can also delete archive files from the Umbraco Deploy dashboard in the Settings section.

Cleaning up export archives

Go to Settings → Deploy. Once you've run at least one export, a Delete all exported ZIP archives section appears. It shows the number of archive files currently stored and a Delete export archives button to remove them all at once.

Delete exported archives

The Deploy dashboard in Settings

If your account has access to the Settings section, a Deploy dashboard is available. It contains:

  • Deploy Status: Shows the current Deploy version, last operation status and time, with a Refresh status button.

  • Deploy operations: Allows to Update Umbraco schema (from .uda files on disk), Verify and clean schema, Export schema (to .uda files on disk), Clear cached signatures, Set cached signatures, and Delete all exported ZIP archives.

  • Download Deploy artifacts — Downloads a zip of all Deploy artifacts representing Umbraco schema as .uda files. This is separate from a content export archive, and is intended for moving schema to another Umbraco instance.

  • Schema comparison: A table per schema kind (Data Type, Document Type, Language, Media Type, Member type, Relation Type, Template, and their container types). It compares what's In Umbraco, whether the File exists on disk, and whether it's Up to date. It contains a Hide up to date toggle and Jump to quick-navigation. Each row has a View details dropdown with Create file and Delete item actions.

  • Configuration details: A read-only view of the current environment's Deploy configuration (for example, Excluded Entity Types, Allow Ignore Dependencies, and so on). Changes must be made in appsettings.json file. This section is for reference only.

Migrating whilst importing

It is possible to migrate schema and content whilst importing. For example, to change Data Type using Nested Content to Block List and ensure content data is imported to the correct Block Editor format.

Deploy contains base classes and implementations to handle common migrations that need to be registered in code, as explained in Import with migrations.

Migrating from Umbraco 7

The import and export feature is not available in Deploy 2 for Umbraco 7. However, a package has been released to allow creating an export. This needs to be done in code and requires additional legacy migrators to be able to import into a newer version. This is explained in Migrating from Umbraco 7.

Service details (programmatically importing and exporting)

Underlying the functionality of import/export with Deploy is the import/export service, defined by the IArtifactImportExportService.

You may have need to make use of this service directly if building something custom with the feature. For example you might want to import from or export to some custom storage.

The service interface defines two methods:

  • ExportArtifactsAsync - takes a collection of artifacts and a storage provider defined by the IArtifactExportProvider interface. The artifacts are serialized and exported to storage.

    • IArtifactExportProvider defines methods for creating streams for writing serialized artifacts or files handled by Deploy (media, templates, stylesheets etc.).

  • ImportArtifactsAsync - takes storage provider containing an import defined by the IArtifactImportProvider interface. The artifacts from storage are imported into Umbraco.

    • IArtifactImportProvider defines methods for creating streams for reading serialized artifacts or files handled by Deploy (media, templates, stylesheets etc.).

Implementations for IArtifactExportProvider and IArtifactImportProvider are provided for:

  • A physical directory.

  • An Umbraco file system.

  • A zip file.

These are all accessible for use via extension methods available on IArtifactImportExportService found in the Umbraco.Deploy.Infrastructure.Extensions namespace.

The following example shows this service in use, importing and exporting from a zip file on startup:

ArtifactImportExportComposer.cs (import and export on startup)

Last updated

Was this helpful?