Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Content Entity Sync (YAML)

70 sites No security coverage
View on drupal.org

This module provides Drush commands to export and import content entities, allowing users to transfer content between Drupal sites by saving entities as YAML files. It supports all entity and field types.

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
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
2.3.0 Stable Feb 15, 2025