Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Easy Import

No security coverage Under active development

This module allows you to quickly export and import content types, entities, and taxonomy terms between Drupal sites. It supports exporting with entity reference fields like users, taxonomies, and content.

Easy Import moves content from one Drupal site to another. Pick the content on one site, download it as a single .zip package of YAML files, and upload it on the other: nodes, taxonomy terms with their hierarchy, other content entities, the files they use, path aliases and the references between them.

It is a Drupal-to-Drupal tool for site builders: both sites have the same content types, vocabularies and fields (for example, kept in step with configuration management). Use it to fill a new site with content from an old one, to copy reference content (a vocabulary, a set of landing pages) between environments, or to seed a development site, without writing a migration.

What it moves

  • Nodes, taxonomy terms and other content entities (media, blocks, menu links, entities from contributed modules): pick entity types and bundles on the Export tab.
  • Every field, base fields and the fields you added, plus the path alias.
  • References by UUID: a node pointing at a term or at another node points at the same item on the other site, even though IDs differ. A taxonomy term keeps its parent, so the hierarchy comes across. Content can point at items that are imported after it.
  • Files of file and image fields go inside the package, with their alt text, title and description (optional).
  • Owners: users are not exported. An owner is matched by user name on the other site; if there is no such user, the person importing becomes the owner.

How it works

  1. On the source site, Configuration » Development » Easy Import (/admin/config/development/easy-import): tick the content types, vocabularies and other bundles, choose whether to include files, and press Export. When the batch finishes, the message has a Download the package link.
  2. On the target site, the Import tab: upload the package and press Upload and preview. A table shows each entity type and bundle, how many items it has, and anything that does not fit this site (a missing bundle, for example).
  3. Press Import. Content already on the site (same UUID) is left alone, or updated when you ticked Update content that is already on this site. Importing the same package twice never makes copies.

The same with Drush: drush easy-import:export content.zip --types=node:article,taxonomy_term, drush easy-import:import content.zip --preview and drush easy-import:import content.zip --update.

The package

A .zip with manifest.yml (format easy_import/2, the source site and Drupal version), content/<entity type>/<bundle>/0001.yml (100 items per file, each with its UUID, language and fields) and files/<uuid>/<name>. It is plain YAML, so you can read it, review it in a merge request or keep it in Git.

Exports from Easy Import 1.x

Version 1.x wrote exports as PHP plugin classes. Upload one of those .php files on the Import tab as it is, or convert it with drush easy-import:convert Articles.php articles.zip. Easy Import reads the file as text and never runs it: only plain values are accepted, and a file with anything else in it (a function call, a variable, a constant) is refused. 1.x exports have no UUIDs, so their references are matched by ID. An update moves 1.x exports that were left in public files to the private file system.

Built to be safe

  • No code from packages: content is data (YAML), never PHP. Old .php exports are tokenised, not included or evaluated.
  • Files land only where they belong: files are written only to public:// or private://. Paths with .., other schemes and code or server-configuration files (.php, .phar, .htaccess and similar) are refused, and an existing file with the same name is kept (the new one is renamed).
  • Packages are checked before they are read: entries are read by name from the zip, never extracted, and there are limits on entry count and size. Entity types, bundles and field names must exist on the site.
  • Downloads are private: a finished package can be downloaded once, by the user who made it, and is then deleted. Packages and uploads that are never used are deleted by cron after a day.
  • Restricted permission: Export and import content with Easy Import is marked as restricted. Exports include unpublished content, and imports can create and change any content, so give it to trusted site builders only.
  • Kernel tests cover the round trip (export, delete, import, import again, update) and the refusals (bad packages, unsafe file paths, code in 1.x exports).

Not moved

  • Users, configuration (content types, fields, views: use configuration management), translations other than the default one, and earlier revisions.
  • Links stored as text with an ID inside them (such as a menu link to entity:node/5, or a link in body text) keep that ID.

Extending it

Package readers are plugins (EasyImportSource, in src/Plugin/EasyImportSource). A module can add a reader for another kind of file by returning the same rows. The two built in are the Drupal package (.zip) and the 1.x export (.php).

Requirements

Drupal ^8.8 || ^9 || ^10 || ^11 || ^12 and PHP's zip extension (the status report says if it is missing). Drush 9 or later for the commands. No other modules. Both sites need the same content types, vocabularies and fields.

Ask your assistant about Easy Import

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.x-dev Dev 10–11 Jan 3, 2025