ai_migrate
The AI Migrate module integrates AI services into the Drupal Migrate framework, enabling automatic AI generation of content summaries, SEO-friendly titles and content categories either restricted to an existing vocabulary or creating new taxonomy terms if no proper existing terms found within your Drupal application.
The module provides Migrate Process plugins to add or update the summaries, titles and taxonomy terms while running content migration either via drush script of through Migrate Plus UI.
As an example, a migration YML is provided that uses Drupal 10 body/value field as a source for the AI-generated content fields such as Drupal CMS field_description or Drupal 11 field_summary.
Features
- Seamless Integration with Drupal AI: Uses Drupal's AI module to configure AI services providers
- Uses AI Content Suggestions' module settings: AI Migrate module relies on AI Content Suggestions module settings for selection of providers, their models and field-specific prompts to automatically generate content summaries, SEO-friendly titles and taxonomy terms during migration.
- Provides Migrate Process plugins to add or update summaries, SEO-friendly titles and AI-selected taxonomy terms for content either already existing in the current Drupal DB or while migrating from an external source.
- Creates AI Migrate Content Migration Group upon installation.
- Uses Migrate Plus YML file for fine tuning migration configuration: Migration YML file also provides configuration settings for Taxonomy Vocabulary to be used during migration and whether the new terms can be added.
Requirements
- Drupal Core: ^10.3 or ^11
- AI (Artificial Intelligence) Core Module: The core AI module must be installed and enabled.
- AI Content Suggestions Module (part of AI framework): Enable ai_content_suggestions module to provide settings for AI providers and prompts.
- Migrate Plus Module: To execute the provided sample migration via UI.
Post-Installation
1. Configure the AI Content Suggestions Providers, AI models and Prompts:
- Navigate to `/admin/config/ai/suggestions`.
- Select AI providers and models for the desired AI-generated fields, using settings in the sections Suggest taxonomy tags, Summarise text and Suggest title.
- Configure prompts for each suggestion if the default prompts do not suit your needs. Note: we found that Suggested Summary length in not more than 80 words fits nicely into CKEditor text area for the Drupal CMS content Description field.
2. Use provided Migrate Plus migration as an example to either migrate from external source or update existing Drupal content while using AI to generate summaries, SEO-friendly titles and taxonomy terms. The sample migration uses Drupal 10 body/value field as a source for the AI-generated Description (Drupal CMS field_description) and also for SEO-friendly Title and Tags (field_tags).
Usage
Once providers and LLM models configured, navigate to /admin/structure/migrate to view and execute migrations in AI Migrate Content Migration Group.
Alternatively, use drush command migrate:import to run the migrations in CLI.
LLMs the Module Was Tested With
The code in this first public release has been thoroughly tested for migrating content from external Drupal 10 source to Drupal CMS and also updating existing Drupal nodes - 13,097 nodes total with agricultural research content. The models used: Gemini 2.5 Flash, GPT-4o, GPT-4.1 and Claude 3.5 Sonnet LLMs. All models show similar performance in creating summaries and titles, but selecting taxonomy terms from existing vocabulary was the best done by Gemini 2.5 Flash LLM.
Supporting this Module
Contributions, bug reports, and feature requests are welcome.