Drupal is a registered trademark of Dries Buytaert

content_entity_sync

76 sites No security coverage
View on drupal.org

This module provides Drush commands for exporting and importing content entities in Drupal. It simplifies the process of transferring content between Drupal instances by allowing users to export any content entity to YAML file and import them into another Drupal installation.

Supports all entity types and all field types.

composer require drupal/content_entity_sync

Features

This module provides a user-friendly and efficient solution for content synchronization.

drush content-entity-sync:export (or drush conex/drush cox): This command allows you to export content entities. You can specify the entity type and optionally filter by bundle. For example, to export all nodes of the "article" bundle, you would run
drush content-entity-sync:export node --bundle=article.

drush content-entity-sync:import (or drush conim/ drush coi): This command is used to import content entities from YAML files. By default, it imports all content entities from the configured content directory. You can also specify the entity type and optionally filter by bundle. For example, to import only nodes of the "page" bundle, you would run
drush content-entity-sync:import taxonomy_term --bundle=tags.

Post-Installation

It is important to note that before using the module, you need to set up the content directory where the exported YAML files will be stored and read from during the import process. This configuration is typically done in Drupal's settings.php file or in a dedicated configuration file.

/**
 * Sets the directory path for storing exported content entities.
 *
 * The $settings['content_sync_directory'] configuration option
 * specifies the directory where the exported content entities will be
 * stored as YAML files during the export process. The value
 * '../content/sync' represents a relative path to the desired
 * directory. In this case, it suggests that the 'content' directory
 * is located in the parent directory of the Drupal installation, and
 * within it, there is a 'sync' directory.
 *
 * Make sure that the specified directory is writable by the web
 * server or the Drupal application, allowing the Content Entity Sync
 * module to successfully write the exported YAML files to the
 * specified directory during the export process.
 *
 * Example: $settings['content_sync_directory'] = '../content/sync';
 */
$settings['content_sync_directory'] = '../content/sync';

By configuring this setting, the Drupal Content Entity Sync module will use the specified directory to store the exported YAML files. This directory serves as a storage location for the exported content entities, allowing them to be easily accessed and imported into other Drupal installations or used for backup purposes.

Menu Link Config: Add menu items from configuration. Works well with entity config dependency names.

Similar projects

Single Content Sync - https://www.drupal.org/project/single_content_sync
Entity Migrate Export - https://www.drupal.org/project/eme
Content Synchronization - https://www.drupal.org/project/content_sync
Content Entity Sync - https://www.drupal.org/project/2890377/git-instructions
Structure Sync - https://www.drupal.org/project/structure_sync

Supporting this Module

Please open an issue.

Activity

Total releases
1
First release
Feb 2025
Latest release
1 year ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
2.3.0 Stable Feb 15, 2025