CMS Content Sync
Enterprise-grade content synchronization module enabling bidirectional content sharing between multiple Drupal sites through a centralized Sync Core service.
cms_content_sync
インストール
composer require 'drupal/cms_content_sync:^3.0'
概要
CMS Content Syncは、複数のDrupalインストール間で高度なコンテンツ同期機能を提供する包括的なDrupal 10/11モジュールです。集中型Sync Coreサービスを使用してコンテンツの配信を管理・オーケストレーションし、マルチサイトインフラストラクチャ全体で一貫したコンテンツを維持できます。
このモジュールは双方向のプッシュ・プル操作をサポートし、サイトは中央リポジトリにコンテンツを公開したり、中央リポジトリからコンテンツを受信したりできます。コンテンツは自動、手動、または関連コンテンツがプッシュされたときに依存関係として同期できます。システムはサイト間のエンティティステータスを追跡し、コンテンツの競合を処理し、翻訳ワークフローをサポートします。
主な機能には、20以上のエンティティタイプ(Node、Media、Taxonomy Term、Menu Link、Paragraphs、Blockなど)のサポート、異なるフィールドタイプ用の19以上のフィールドハンドラー、リモート操作用のREST API統合、大規模同期用のバッチ処理、設定と監視のための包括的な管理インターフェースが含まれます。
Features
- 集中型Sync Coreサービスを使用した複数Drupalサイト間の双方向コンテンツ同期(プッシュ/プル)
- 同期するコンテンツタイプ、バンドル、フィールドをきめ細かく制御できるFlow管理システム
- サイト間でのコンテンツのグループ化とアクセス制御を可能にするPoolベースのコンテンツ構成
- Node、Media、Taxonomy Term、Menu Link、Paragraphs、Block、File、Config Pages、Entity Queue、Group Contentを含む10以上のエンティティタイプのサポート
- テキストフィールド、エンティティ参照、Paragraphs、ファイル、画像、Layout Builder、Moderation State、リンク、パス、Webformなどをサポートする19種類のフィールドハンドラー
- 同期履歴、タイムスタンプ、障害検出を含むリアルタイムエンティティステータス追跡
- リモートサイト通信とSync Core統合用のREST APIエンドポイント
- タイムアウトを防ぐ大規模プッシュ/プル操作用のバッチ処理
- 言語対応の同期と独立した翻訳処理による翻訳サポート
- 同期関係を維持しながらローカル変更を許可するコンテンツ上書き保護
- リモートサイトからのコンテンツ発見と選択的インポートのための手動プルダッシュボード
- 同期ステータス、障害、設定問題を追跡するヘルス監視ダッシュボード
- CLIベースの設定エクスポート、プッシュ、プル、ステータス管理用のDrushコマンド
- Acquia Content Hubからの移行ツール
- ローカル開発環境および非公開サイト用のプライベート環境サポート
- 同期されたコンテンツ順序付け用のDraggableViews統合
- サイト間で双方向にコンテンツをフローさせるクロス同期機能
Use Cases
Multi-site Content Distribution
A central editorial team creates content on a primary Drupal site and pushes it to multiple regional or brand-specific sites. Each regional site automatically receives new content, updates, and deletions while maintaining local customizations through the override feature.
Content Staging Workflow
Content is created and edited on a staging environment, then pushed to production when approved. The staging site pushes content while the production site pulls, ensuring controlled content deployment with full translation support.
Decoupled Content Repository
Multiple frontend applications (web, mobile, kiosk) pull content from a central Drupal repository. The repository pushes content to a Sync Core which then distributes to consuming applications, enabling true headless architecture.
Franchise/Dealer Network
A corporate site maintains core content (products, policies, brand assets) that is automatically distributed to hundreds of franchise sites. Local sites can add their own content while receiving corporate updates, with pool-based access control.
Editorial Collaboration Across Sites
Multiple editorial teams across different sites can push content to shared pools, enabling cross-site content reuse. Each site maintains control over what content it receives through flow configuration.
Content Migration and Consolidation
Legacy content from multiple older Drupal sites is pulled into a new central platform. The migration submodule helps transition from Acquia Content Hub, and entity mapping ensures content relationships are preserved.
Tips
- Always export configuration after making flow changes using the UI or 'drush cse' command
- Use the Health dashboard (cms_content_sync_health submodule) to monitor synchronization status and identify failures
- For development environments behind firewalls, enable the private_environment submodule to use request polling
- When copying flows from remote sites, use the transformation options to adjust push/pull settings for your site's role
- Entity type versions are calculated automatically - if you see version mismatches, use the developer submodule to identify field differences
- Use pool-based organization to control which sites receive which content types
- The 'Override' checkbox on content allows local modifications while still tracking the sync relationship
- For large initial synchronizations, use Drush commands with the --type option to process in batches
- Preview functionality for the pull dashboard requires enabling it in settings and re-exporting flows
- Configure deletion settings carefully - pushed deletions will remove content from receiving sites
Technical Details
Admin Pages 10
/admin/config/services/cms_content_sync/site
Register and configure your site with the Sync Core service. View site status, UUID, and connection details.
/admin/config/services/cms_content_sync/syndication
Embedded React dashboard showing real-time syndication progress, content status across sites, and sync operations.
/admin/config/services/cms_content_sync/pool
Manage content pools - logical groupings of content that control synchronization scope and access.
/admin/config/services/cms_content_sync/pool/add
Create a new content pool for organizing synchronized content.
/admin/config/services/cms_content_sync/flow
Manage synchronization flows that define which content types and fields are synchronized and how.
/admin/config/services/cms_content_sync/flow/add
Create a new synchronization flow defining what content is synchronized and how.
/admin/config/services/cms_content_sync/settings
Configure global settings for content synchronization including authentication, base URL, and logging.
/admin/config/services/cms_content_sync/compatibility
View entity type and field type support matrix showing which types can be synchronized.
/admin/config/services/cms_content_sync/flow/copy/remote
Multi-step wizard to copy flow configuration from another connected site.
/admin/cms-content-sync/publish-multiple-changes/confirm/{entities}
Confirmation dialog for pushing selected entities to other sites with translation and priority options.
権限 9
Hooks 6
hook_cms_content_sync_entity_handler_info_alter
Alter entity handler plugin definitions
hook_cms_content_sync_field_handler_info_alter
Alter field handler plugin definitions
hook_cms_content_sync_before_entity_push
Called before an entity is pushed, allowing modifications or cancellation
hook_cms_content_sync_after_entity_push
Called after an entity is successfully pushed
hook_cms_content_sync_before_entity_pull
Called before an entity is pulled, allowing modifications or denial
hook_cms_content_sync_after_entity_pull
Called after an entity is successfully pulled
Drush Commands 6
drush cms_content_sync:configuration-export
Export all pool and flow configuration to the Sync Core service
drush cms_content_sync:pull
Pull entities from the Sync Core for a specific flow
drush cms_content_sync:push
Push entities to the Sync Core for a specific flow
drush cms_content_sync:reset-status-entities
Reset synchronization status for all entities in a pool, clearing push/pull timestamps
drush cms_content_sync:check-entity-flags
Check synchronization flags for a specific entity by UUID
drush cms_content_sync:register
Register this site with the Content Sync backend service
Troubleshooting 7
1. Verify the flow is active and exported (check for 'Export required' warning). 2. Ensure the entity type/bundle is configured for push in the flow. 3. Check that at least one pool is set to 'Force' or 'Allow'. 4. Verify the site is registered with the Sync Core. 5. Run 'drush cse' to export configuration. 6. Check watchdog logs for errors.
1. Verify the flow has pull configured for the entity type. 2. Check pool settings allow pulling from the source pool. 3. Ensure the pulling site's entity type version matches the source. 4. Check for required fields that may be missing. 5. Review the Health dashboard for pull failures.
Entity type versions are calculated from field configuration. When fields differ between sites, versions won't match. Enable the developer submodule to see specific differences. Either add missing fields to both sites or configure the flow to ignore the mismatched fields.
1. Ensure file entities are configured in the flow (either directly or as dependencies). 2. Check that the file handler is selected for file/image fields. 3. Verify the destination site can write to the file directory. 4. For private files, ensure authentication is configured correctly.
1. Verify both sites have the same languages enabled. 2. Check flow configuration for translation handling. 3. For independent translation handling, each translation is pushed separately. 4. Ensure the default language exists on both sites.
When pushing content with untranslated reference fields containing new embedded entities, all translations may be pushed. This ensures embedded content is available in all languages. The confirmation dialog explains this behavior.
1. Use Drush commands (cs-push, cs-pull) instead of UI for bulk operations. 2. Enable batch processing. 3. Consider filtering by entity type or bundle. 4. Check Sync Core status for queue backlog. 5. Enable extended logging temporarily to identify bottlenecks.
Security Notes 8
- CMS Content Sync uses encrypted storage (Real AES) for authentication credentials - ensure the encryption key is properly configured and secured
- REST endpoints are protected by Drupal's permission system - review role assignments for REST permissions carefully
- The dedicated 'cms_content_sync' user role should only be assigned to the system user, not human users
- Basic Auth authentication type may expose credentials if not used over HTTPS - always use HTTPS in production
- When using private environments with request polling, be aware that requests originate from the Sync Core service
- The 'allow local deletion of import' setting should be carefully considered - enabling it allows users to delete content that came from other sites
- Extended logging options capture full entity data in watchdog - disable after debugging to avoid storing sensitive content in logs
- Site registration tokens expire after 5 minutes - do not store or share them