Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Default Content Deploy

Security covered Under active development 2,939 sites

This module allows you to export and deploy content between Drupal instances, optionally managing it within Git. It handles relationships and dependencies, even for links and text, and can manage different entity IDs across sites.

  • Export and deploy content to other instances
  • Optionally maintain it in git
  • Takes care about relations and dependencies, even in links or text
  • Handles different entity IDs on different instances

WARNING! Due to a critical bug in the HAL module, entity references get lost during import with 2.2.0

There's a pending patch for the HAL module to fix the issue:
#3517446: Cached relation IDs are broken

Introduction

This module (DCD) provides content deployment and allows development and building sites without the need to transfer database between the sites. The development team can export and deploy all content via Git and content can be deployed to the staging servers automatically during common deploy processes. Module provides useful drush commands for export/import content. Import function can also be ran from administration interface.

There's also an integration in Search API that leverages Search API's capabilities to track content changes and filter them to configure different "continuous content export streams".

DCD is also suitable to synchronize content between different instances in production.

Join Our Drupal Slack Channel for support.

Requirements

This module does not depend on the Default Content module (default_content)!

If you want to export files you should install the optional requirement Better Normalizers (better_normalizers).

If you want to export Layout Builder settings per entity or translations you'll currently run into two core issues you should patch:

Installation

Download and enable module.

Configuration

Set DCD content directory in settings.php. We recommend to place directory outside of the document root. If no configuration is found, directory is created automatically at 'public://content_' . $hash_salt;

Example

// Relative path.
$settings['default_content_deploy_content_directory'] = '../content';
// Absolute path.
$settings['default_content_deploy_content_directory'] = '/var/dcd/content';

Usage - Drush commands

Read detail information about drush commands in README.md.

  • default-content-deploy:export (dcde) Exports a single entity or group of entities.
  • default-content-deploy:export-with-references (dcder) Exports a single entity or group of entities with references.
  • default-content-deploy:export-site (dcdes) Exports a whole site's content.
  • default-content-deploy:import (dcdi) Import all the content defined in a content directory.
  • default-content-deploy:uuid-info (dcd-uuid-info) Get current System Site, Admin and Anonymous UUIDs, Admin name.
  • default-content-deploy:entity-list (dcd-entity-list) List current content entity types.

How the content is imported

drush dcdi

  • Imported entity is determined by UUID (it can be either new or already existing).
  • ID of an entity is not preserved unless the --preserve-ids option is used (and you know what you're doing), so it can change its ID to avoid conflicts.
  • References by entity ID will be corrected during import based on UUIDs
  • Existing entity is updated only if imported entity is newer (by timestamp of the last entity change across all translations).
  • Imported entity with the same or older time than the current existing entity is skipped.
  • This behavior can be changed by parameter --force-update

drush dcdi --force-update

  • Existing entity is overwritten by the imported entity (the old entity is deleted and a new entity with the same entity ID is created from imported JSON file).
  • There is an exception for the user-type entity that only updates the UUID and the username, because overwriting a user entity would result in creating a blocked user without password and email (the user entity export JSON file doesn't contain such information).

drush dcdi --verbose
Print detailed information about importing entities.

If you can not use Drush for import, go to page /admin/config/development/dcd-import.

Team workflow - how to synchronize configuration and content between sites

Please, read the README.md for detailed information.

Credits

Originally written by @martin_klima and @hnilickajakub with kind support of @hideaway.
Maintained by @miroslav-lee @mkalkbrenner.

Drupal 10–11

Ask your assistant about Default Content Deploy

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

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
16
Tracked since
Jul 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 9
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.2.0-beta3 Pre-release 10–11 May 14, 2025
2.2.0-beta2 Pre-release 10–11 Apr 28, 2025
2.2.0-beta1 Pre-release 10–11 Apr 9, 2025
2.2.x-dev Dev 10–11 Mar 28, 2025
2.1.4 Stable 10–11 Mar 6, 2025
2.1.3 Stable 10–11 Feb 27, 2025
2.1.2 Stable 10–11 Feb 26, 2025
2.1.1 Stable 10–11 Nov 26, 2024
2.1.0 Stable 10–11 Nov 18, 2024
2.1.0-rc1 Pre-release 10–11 Oct 15, 2024