WordPress to Drupal Migration Documentationfor Drupal 11 , 10 , 9 , and 8

Last updated :  

 

Method: CSV-Based Migration Using Drupal Feeds


1. Migration Approach Overview

The migration follows these high-level steps:

  1. Export content from WordPress in CSV format
  2. Copy WordPress media files to Drupal
  3. Configure Drupal modules and content structure
  4. Create Feeds importers
  5. Map fields and apply data transformations
  6. Import and validate content

2. WordPress Content Export

2.1 Plugin Used

2.2 Export Requirements

Export all required content types (posts, pages, or custom post types) into CSV files. Each CSV should include:

  • Unique ID (mandatory)
  • Title
  • Body/Content
  • Author
  • Publish Date (timestamp preferred)
  • Featured Image URL
  • Categories and Tags
  • Any custom fields

Note: Separate CSV files are recommended for Users, Taxonomies, and Content.


3. Media Migration

3.1 Media File Transfer

Copy the WordPress uploads directory:

public_html/wp-content/uploads

Paste it into the Drupal files directory:

web/sites/default/files

3.2 Purpose

This ensures existing media files are available locally in Drupal and can be referenced during import without re-uploading.


4. Drupal Module Requirements

4.1 Required Modules

Install the following modules using Composer:

composer require drupal/feeds \
  drupal/feeds_ex \
  drupal/feeds_files_by_media \
  drupal/feeds_tamper_media_url \
  drupal/tamper

4.2 Module Purpose

ModulePurpose
FeedsCore CSV import framework
Feeds ExAdvanced CSV parsing options
Feeds Files by MediaMedia-based file handling
Feeds Tamper Media URLMedia creation from URLs
TamperData transformation (date, explode, format)

Enable all modules after installation.


5. Drupal Content Structure Preparation

Before importing data, the Drupal structure must match the WordPress structure.

5.1 Content Types

  • Create content types corresponding to WordPress post types
  • Create all required fields with matching data types

5.2 Taxonomies

  • Create taxonomies (e.g., Categories, Tags)
  • Add taxonomy reference fields to relevant content types

5.3 Media Types

  • Create a Media Type: Image
  • Ensure the following field exists:
    • field_media_image

6. Feeds Importer Configuration

6.1 Access Feeds UI

Navigate to:

/en/admin/structure/feeds

6.2 Create Feed Types

Create separate Feed Types in the following order:

  1. User Import
  2. Taxonomy Import
  3. Content (Node) Import

6.3 Feed Type Settings

For each Feed Type:

SettingValue
FetcherUpload File
ParserCSV
ProcessorUser / Taxonomy Term / Node


 

Feeds Module CSV Upload Example

7. Field Mapping and Data Transformation

7.1 Reference Fields (Taxonomy / Entity Reference)

  • Enable Auto-create
  • Select the correct Bundle Name
  • Ensure correct target entity type
     

    Feeds Mapping

7.2 Media and Image Fields

  • Map image URL field
  • Use Tamper → Media URL
  • Configuration:
    • Media Type: image
    • Media Field: field_media_image
  • Select File ID where applicable
     

    Media Temper Setting

7.3 Date Fields

  • Use Tamper → Unix Timestamp to Date
  • Input: Unix timestamp
  • Output date format:

    d-m-Y

7.4 Taxonomy Fields (Categories / Tags)

  • Use Tamper → Explode
  • Separator:
    • | or , (based on CSV format)

8. Import Execution

8.1 CSV Upload

  • Upload the CSV file via the Feed UI
  • Ensure a unique ID field is mapped

8.2 Import Behavior

  • Unique ID prevents duplicate content
  • Re-import updates existing records instead of creating new ones

9. Validation and Quality Checks

After import, verify:

  • Content nodes are created correctly
  • Images are linked and displayed properly
  • Taxonomies are auto-created and referenced
  • Dates are correctly formatted
  • No duplicate entries exist

10. Known Limitations

  • Complex relationships may require multiple CSVs
  • Performance may degrade with very large datasets
  • Advanced migrations may require batching or cron-based imports

11. Recommended Alternatives (Optional)

For large or complex migrations, consider:

  • Drupal Migrate API
  • Migrate Plus + Migrate Tools
  • Direct database migration for high-volume projects

12. Conclusion

This CSV-based migration approach using Drupal Feeds provides a reliable and flexible method for migrating WordPress content to Drupal, especially when media reuse and structured imports are required.