Drupal2WP Toolkit

Flexible content migration and taxonomy structuring for modern WordPress sites.

Drupal2WP Toolkit provides an extensible command-line and plugin-based bridge between Drupal 8 or higher and WordPress 6, optimized for developers handling structured content migration. It includes taxonomy mapping, sortable categories, UI enhancements, and future-ready plans for block-based template integration.


⚙️ Features

  • Drupal → WordPress Migration

    • Imports all Drupal nodes as WordPress Pages by default
    • Vocabulary terms are converted into top-level categories
    • Associated Drupal terms become sub-categories under their vocabularies
    • Drupal content types are added as top-level categories for structural clarity
  • Admin UI Enhancements

    • Adds a sortable Last Modified column to Pages view
    • Top-level categories are also sortable
    • Category filters available directly in admin for Pages
  • Standalone Media Import Tool

    • Batch import media from local directories into WordPress
    • Recursively processes images, documents, and audio files
    • Supports test mode for dry-run validation
  • WP-CLI Utilities

    • Run wp drupal2wp_toolkit --help to learn about Drupal content porting
    • Easily convert migrated Pages into Posts, retaining taxonomy mapping

🚀 Future Plans

  • Block Theme Editor Integration

    • Assign categories to custom templates or reusable block layouts
    • Enable GUI-based taxonomy-driven theming inside WordPress's Site Editor
  • Advanced Taxonomy Mapping

    • Support for custom post types and multi-taxonomy assignment
  • Content Blueprinting

    • Define reusable structures based on imported vocabularies and content types

🧰 Installation

🔐 Drupal Database Configuration

Drupal2WP Toolkit connects to your Drupal database using WordPresss native wpdb class, with credentials securely managed via environment variables.

This approach keeps sensitive connection details out of your codebase and allows flexible configuration across environments (local, staging, production).

Required Environment Variables

Set the following in your server environment or .env file:

DRUPAL_DB_USER=your_drupal_db_username
DRUPAL_DB_PASS=your_drupal_db_password
DRUPAL_DB_NAME=your_drupal_db_name
DRUPAL_DB_HOST=your_drupal_db_host
  1. Clone the repository into your WordPress plugins directory:

    git clone https://git.bikeshopi.dev/bike/drupal2wp_toolkit.git wp-content/plugins/drupal2wp_toolkit
    
  2. Activate the plugin:

    wp plugin activate drupal2wp_toolkit
    
  3. Run the import command:

    wp drupal2wp_toolkit --type=story,hidden_content,vidcast,news_article,resources
    

📷 Media Import Tool

Standalone bash script for importing media files into WordPress.

Usage

# Full import from sites/ directory
./media-import

# Test mode (first 10 files only)
./media-import --test

Requirements

  • WP-CLI installed and accessible
  • WordPress path: /var/www/html (hardcoded in script)
  • Run as web server user or use --allow-root
  • Source files in sites/ subdirectory (relative to script location)

🙌 Credits

Contributions and feedback welcome, For contributions, reach out to @bike — this is a toolkit built for extensibility.

📄 License

GNU GENERAL PUBLIC LICENSE

Description
Flexible content migration and taxonomy structuring for modern WordPress sites.
Readme 54 KiB
Languages
PHP 95.6%
Shell 4.4%