We’ve always had a challenge synchronizing content across Drupal environments.

We’ve seen significant progress in the management of system configuration; however, we lack an effective way to deploy content in a similar fashion.

As a result, we’ve spent a lot of time synchronizing content either through migration scripting, import and export files, or “good old fashion” copy and paste.

The content synchronization module provides a mechanism to export single content items, or all content items, from an environment, and move them to another, effortlessly.

IMPORTANT: Updating from version 8.x-1.x to 8.x-2.x or 3.0.0-beta1
YAML content entity files are different from version 8.x-1.x as refactoring of code was needed to implement more functionality. the same version has to run on the source and target sites.

Version 8.x-1.x won't be supported, to move from version 8.x-1.x to 8.x-2.x or 3.0.0-beta1:

  • Uninstall version 8.x-1.x (source and target sites)
  • Install version 8.x-2.x (source and target sites)
  • Update settings.php to include the content directory (instructions below)
  • Import/Export content entities

Current Features

  • Exporting the full site content - You can create and download an archive consisting of all your site's content exported as *.yml files on the Export page (/admin/config/development/content/export/full).
  • Importing a site full content - You can upload a full site content from an archive file on the Import page (/admin/config/development/content/import/full). When importing data from a different environment, the site and import files must have matching site UUID. That means that your other environments should initially be set up as clones of the target site.
  • Exporting a single content item - You can export a single content item by selecting a content entity type, name and id on the Single export page (/admin/config/development/content/export/single).
  • Importing a single content item - You can import a single content item by pasting it in YAML format into the form on the Single import page (/admin/config/development/content/import/single).
  • View differences. See the difference between site content and what is in the YAML files using a new content synchronizations screen.
  • Import entities with parent/child relationship. Taxonomy terms, menu items, and other entities can be imported while maintaining their parent / children relationship.
  • Set the export directory in settings.php. Similar to configuration management, we want to set the export directory for YAML files using the settings.php file.le:
    Use the variable: $content_directories['sync']
    ie:
    global $content_directories;
    $content_directories['sync'] = $app_root.'/../content/sync';

    Note: set $content_directories as global

Upcoming Features

  • Exporting content into subdirectories. This will allow us to export very large sites without causing performance issues.
  • Splitting export archives. When exporting content into an archive, we want to set the maximum archive size to 100MB to avoid memory limit issues
  • Setting options to skip updates, deletes, inserts.
  • Option to select stage content to be imported (Instead of single content or all content).

Current Project Status: Seeking Feedback

Today, the content synchronization module enables you to synchronize content between environments. It supports all entity and field types. However, we believe there is still work to be done. Please share your ideas within the issue queue.

Slack channel for content synchronization module support #content-sync.

Supporting organizations: 
Sponsored
Sponsored

Project information

Releases