migrate_forward_draft
When you import or update content with Migrate, Drupal usually writes to the default revision (what visitors see as published). On sites using workflows and content moderation, editors often save a newer draft revision that is not the default—a “forward” draft. If that draft is ahead of the live revision, a migration rerun can leave the published node correct while the draft still has outdated values for fields the migration owns, or create confusing revision history. Migrate Forward Draft provides a migrate destination plugin that, on update, captures that forward draft before the migration saves, updates the default revision from your migration, then saves a new non-default revision that carries the editor’s work forward. You can overlay selected fields from the freshly imported default onto that replayed draft so drafts stay aligned with your source where you want that.
Features
Basic functionality: A Migrate destination that is aware of “forward” (newer non-default) draft revisions and replays them after the default revision is updated by an import.
Unique behavior:
- Forward-draft detection before the migration updates the entity.
- Replay as a new non-default revision after the default is updated, so moderation and revision workflows stay meaningful.
forward_revision_overwrite_properties—choose which properties (often fields) to copy from the new default onto the replayed draft (e.g. migration-owned titles or IDs) while other draft values stay editor-owned.migration_sync(default matches core)—controlssetSyncing(TRUE)on the main migrate save; the forward-draft replay save does not use syncing, which matters for content moderation and custom subscribers.- Derivative plugins such as
entity_with_forward_draft:node(and other supported entity types), similar in spirit to core entity destinations.
When and why to use it: External feeds or APIs own metadata on nodes (or similar entities) while editors enrich the same content in draft; reruns must refresh published data without stranding drafts with stale migrated values or losing editorial work.
Post-installation
There is no configuration page. After enabling the module:
- Open your migration configuration (YAML or exported config).
- Set the destination to
entity_with_forward_draft:node(or the appropriate derivative for your entity type). - Keep your usual destination settings for updating the default revision (e.g.
overwrite_properties). - Add
forward_revision_overwrite_propertieswith property names to copy from the new default onto the replayed draft, or omit/leave empty if you only need the draft replayed without copying from default. - Optionally set
migration_synctotrueorfalseso the main migrate save matches how your site’s code expects syncing to behave.
Rebuild caches if needed. Test on a copy of production data that includes real forward drafts before using in production.
Additional requirements
- Drupal core with the Migrate module (
migrate) enabled—required dependency. - Content moderation is not a package dependency; the module is most useful when the site uses revisions and non-default drafts. Only revisionable, fieldable entity types are targeted (same general idea as core revision-related migrate plugins).
Recommended modules/libraries
- Content Moderation (core) when drafts ahead of published content are part of your workflow.
- Migrate Plus and related tools if you manage many migrations or need extra plugins—this module only changes the destination behavior.
Similar projects
Core entity:node and similar entity:* destinations update the default revision and do not implement forward-draft capture and replay. Core entity_revision and revision import patterns solve different problems. Migrate Forward Draft is aimed at reruns that refresh the published revision while keeping forward drafts coherent, with optional per-property sync from default to draft.
Supporting this module
Issue queue contributions, patches, and feedback help improve the module. There is no required commercial support channel to use it.
Community documentation
See the project README for YAML examples and detailed behavior. Add links here over time to blog posts, videos, DrupalPod demos, or external docs as the community publishes them.
An optional demo submodule may be included with sample migrations—enable only on non-production environments to try the destination in isolation.