FG Drupal to WordPress

Description

This plugin migrates articles, stories, pages, categories, tags and images from Drupal to WordPress.

It has been tested with Drupal 5, 6, 7 & 8 and WordPress 4.9. It is compatible with multisite installations.

Major features include:

  • migrates the Drupal articles
  • migrates the Drupal 6 stories
  • migrates the Drupal basic pages
  • migrates the Drupal categories
  • migrates the Drupal tags
  • migrates the Drupal images
  • uploads all the posts media in WP uploads directories
  • uploads external media (option)
  • modifies the post content to keep the media links
  • resizes images according to the sizes defined in WP
  • defines the featured image to be the first post image (option)
  • keeps the alt image attribute
  • modifies the internal links
  • compatible with the MySQL, PostgreSQL and SQLite Drupal database drivers

No need to subscribe to an external web site.

Premium version

The Premium version includes these extra features:

  • migrates the comments
  • migrates the authors
  • migrates the administrators
  • migrates the users
  • migrates the custom post types
  • migrates the custom taxonomies
  • migrates the custom fields
  • authenticates the users with their Drupal passwords
  • SEO: redirects the Drupal URLs to the corresponding WordPress URLs
  • Ability to not import some data
  • Ability to import only specific node types
  • Import and replace the Image Assist shortcodes
  • Import the images managed by the Image Attach Drupal module
  • Import the nodes relationships

The Premium version can be purchased on: https://www.fredericgilles.net/fg-drupal-to-wordpress/

Add-ons

The Premium version allows the use of add-ons that enhance functionality:

  • CCK Custom Content Kit
  • Meta tags
  • Location custom fields
  • Ubercart store
  • Name custom fields
  • Addressfield custom fields
  • Internationalization
  • NodeBlock fields
  • EntityReference relationships
  • Media Provider (S3, SoundCloud, YouTube media)
  • Forum

These modules can be purchased on: https://www.fredericgilles.net/fg-drupal-to-wordpress/add-ons/

Translations

  • English (default)
  • French (fr_FR)
  • other can be translated

Screenshots

  • Parameters screen

Installation

  1. Install the plugin in the Admin => Plugins menu => Add New => Upload => Select the zip file => Install Now
  2. Activate the plugin in the Admin => Plugins menu
  3. Run the importer in Tools > Import > Drupal
  4. Configure the plugin settings. You can find the Drupal database parameters in the Drupal file sites/default/settings.php

FAQ

Installation Instructions
  1. Install the plugin in the Admin => Plugins menu => Add New => Upload => Select the zip file => Install Now
  2. Activate the plugin in the Admin => Plugins menu
  3. Run the importer in Tools > Import > Drupal
  4. Configure the plugin settings. You can find the Drupal database parameters in the Drupal file sites/default/settings.php
I get the message: “[fg-drupal-to-wp] Couldn’t connect to the Drupal database. Please check your parameters. And be sure the WordPress server can access the Drupal database. SQLSTATE[28000] [1045] Access denied for user ‘xxx’@’localhost’ (using password: YES)”
  • First verify your login and password to the Drupal database.
    If Drupal and WordPress are not installed on the same host:
  • If you use CPanel on the Drupal server, a solution is to allow a remote MySQL connection.
    • go into the Cpanel of the Drupal server
    • go down to Database section and click “Remote MySQL”
    • There you can add an access host (WordPress host). Enter the access host as the SOME-WEBSITE-DOMAIN-OR-IP-ADDRESS and click add host.
  • Another solution is to copy the Drupal database on the WordPress database:
    • export the Drupal database to a SQL file (with phpMyAdmin for example)
    • import this SQL file on the same database as WordPress
    • run the migration by using WordPress database credentials (host, user, password, database) instead of the Drupal ones in the plugin settings.
I get this error when testing the connection: “SQLSTATE[HY000] [2002] Connection refused” or “SQLSTATE[HY000] [2002] No such file or directory”
  • This error happens when the host is set like localhost:/tmp/mysql5d.sock
    Instead, you must set the host to be localhost;unix_socket=/tmp/mysql5d.sock
The migration stops and I get the message: “Fatal error: Allowed memory size of XXXXXX bytes exhausted” or I get the message: “Internal server error”
  • First, deactivate all the WordPress plugins except the ones used for the migration
  • You can run the migration again. It will continue where it stopped.
  • You can add: define('WP_MEMORY_LIMIT', '512M'); in your wp-config.php file to increase the memory allowed by WordPress
  • You can also increase the memory limit in php.ini if you have write access to this file (ie: memory_limit = 1G). See the increase memory limit procedure.
The media are not imported
  • Check the URL field that you filled in the plugin settings. It must be your Drupal home page URL and must start with http:// or https://
The media are not imported and I get the error message: “Warning: copy() [function.copy]: URL file-access is disabled in the server configuration”
  • The PHP directive “Allow URL fopen” must be turned on in php.ini to copy the medias. If your remote host doesn’t allow this directive, you will have to do the migration on localhost.
I get the message: “Fatal error: Class ‘PDO’ not found”
  • PDO and PDO_MySQL libraries are needed. You must enable them in php.ini on the WordPress host.
    Or on Ubuntu:
    sudo php5enmod pdo
    sudo service apache2 reload
I get this error: PHP Fatal error: Undefined class constant ‘MYSQL_ATTR_INIT_COMMAND’
  • You have to enable PDO_MySQL in php.ini on the WordPress host. That means uncomment the line extension=pdo_mysql.so in php.ini
Does the migration process modify the Drupal site it migrates from?
  • No, it only reads the Drupal database.
I get this error: Erreur !: SQLSTATE[HY000] [1193] Unknown system variable ‘NAMES’
  • It comes from MySQL 4.0. It will work if you move your database to MySQL 5.0 before running the migration.
I get this error “Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM”
  • You must use at least PHP 5.3 on your WordPress site.
I get this error: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
  • It is a compatibility issue with your version of MySQL.
    You can read this post to fix it: http://forumsarchive.laravel.io/viewtopic.php?id=8667
None image get transferred into the WordPress uploads folder. I’m using Xampp on Windows.
  • Xampp puts the htdocs in the applications folder which is write protected. You need to move the htdocs to a writeable folder.
Do I need to keep the plugin activated after the migration?
  • No, you can deactivate or even uninstall the plugin after the migration (for the free version only).
My screen hangs because of a lot of errors in the log window
  • You can stop the log auto-refresh by unselecting the log auto-refresh checkbox

Don’t hesitate to let a comment on the forum or to report bugs if you found some.

Reviews

Thought it couldn’t be done

I migrated a Drupal site with a difficult module (Field Collection) that couldn’t be migrated in the right manner. I checked with the support and they were fast and thorough. Where as in Drupal itself the module was hard to convert to an exportable field, Frédéric said he could write an add-on for it. And he did within a couple of hours. After that I successfully migrated my site which saved me a ton of work!
A great tool with even greater support and dedication!

This plugin is good, but needs a lot of work

I would love to give this plugin five stars, but it’s not ready for prime time.

There are a bunch of issues.

It may be only my use case and it may be a Drupal issue related to not updating Drupal to the latest version before export. I don’t know, but there should be some notification in the plugin – a checks of sort to make sure everything is in alignment before you run the process.

When the plugin pulled in all posts from Drupal on Pantheon’s servers, it finally timed out short of all articles and did not pull in any of the CCK nodes that were set up, nor did it pull in all users. It stopped and wouldn’t start. In the plugin’s defense, Pantheon does not allow edit of the php.ini file with the rules provided by the plugin developer. It’s more likely than not that your server administrator / host will not allow the settings recommended by the plugin developer. Both WP Engine and Pantheon would either not allow the max limits recommended or not allow edit of php.ini at all on a shared environment. So, if you’re not on a dedicated host, you’re out of luck.

I then switched over to local. When I downloaded the database from Pantheon and uploaded to MAMP SQL PRO, then I ran the import, for some reason, it pulled in thousands of more articles than the logs said were available. The logs said 4,440, but it pulled in over 11K. And, when it did that, it for some reason started pulling in everything correctly, I was monitoring the Posts in another window and I saw it go to about a week before the most recent publish date. All of a sudden, everything back to a year and half was done, and then all posts started copying in quadruplicate (either 4 or 5 copies of a post), and then as the plugin ran some more, it finally started pulling in post to the most recent post. Over 11,500 later and there are supposed only be about 5,500 according to the client. So, I don’t know what went wrong, but now there’s going to be spent some time on cleanup.

The plugin doesn’t actually tell you when each node completes, you have to rely on the progress bar. And, the progress bar got to 100%, but then the import kept running, because not all nodes were imported yet. As of this writing, I’m up to 108%. How can a progress bar say 100%, but then the process is still not completed. It needs to have a progress bar for each node, not the entire database.

So, while doing this has saved me manual .sql parsing time or paying someone else to do it, it’s caused me all kinds of other issues.

It may not be the plugin developers fault – it may be how Drupal was set up by the original developer. I don’t know. But what I do know is that my use case was not necessarily planned for in the minds of the creators of this plugin, and they have a fair amount of work to do to make this better.

Their paid support is also a little slow. I went over 24-hours without a response to a question, even though I purchased the upgrade. They need to be better at their response times.

UPDATE: I actually got to 111% “Import Completed” but it’s still running and registering the last set of posts from one node, even though it says it’s completed.

2nd UPDATE: After working with my hosting company and the plugin developers, I was able to ascertain that many hosts won’t allow modification of php or server settings to increase time out responses and other factors that can help when using this plugin. Every time I ran the plugin on a dev environment at Pantheon, it would crap out and not complete. So, I had to go to the next level and do a local install using MAMP to host the site on my local machine, then export the SQL DB from Drupal and import using SQL Pro in MAMP.

Once I had all that working, I had some duplicate issues where POSTS would duplicate 4 or 5 times each and CCKs coming over would come over correctly. Then I changed to a recommended my.conf setting given to me by support and it reversed where POSTS would come in normally and CCKs would duplicate.

After contact support again, they optimized those files. I installed them in their respective folders. I restarted and it seems to have fixed the duplicates issue.

Therefore, I’m updating my review to 4 stars and not 3. It’s still not a 5-star experience, but support was helpful in walking me through some things and optimizing the config files for me.

Excellent plugin and great service!

Excellent plugin, works as espected!

When we found any problem, all of them were solved very fast.

Excellent technical service who only tries to help you, no tells you any excuses.

Very pleased!

Terrific plugin, does the job

Though the plugin is missing WP-CLI integration, it is easy enough to use from the WP Admin UI. There are many options for what to import, both on initial import and on updates from Drupal.

The plugin imports custom fields using the external Toolset Types plugin integration, so the data needs massaging for use with Advanced Custom Fields users. This is easy enough to do with a few lines of code. Likewise, most of the data is easily accessible, for instance I was able to convert a Drupal Taxonomy (which is imported as a WordPress Taxonomy) to an ACF custom field very easily.

This plugin is worth the price and it undoubtedly saved me days of work. Very highly recommended.

Great plugin, even greater support

We want to transfer a drupal install with 10.000 nodes and a multitude of custom post types and custom fields, and we saved lots of time with this plugin. There were some unsupported custom field types in our installation, but they added them in a matter of days after we asked them do.
Worth the money.

Very good plugin and support

i’ve used the plugin for migrate a quite big site, almost 3000 pages and maybe 5000 document (pdf, doc) attached..
the plugin by it self worked great, but the best part was the support!

it was my first time with a drupal site and the guys helped me so much!

thanks again for the incedible support 😉

Read all 36 reviews

Contributors & Developers

“FG Drupal to WordPress” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.58.0

  • New: Check if the Field Collection Drupal module is used

1.57.2

  • Fixed: The media containing attributes or anchors in their link were not imported
  • Tested with WordPress 4.9.5

1.56.0

  • New: Check if the Nodewords Drupal module is used
  • New: Check if the Page Title Drupal module is used

1.53.0

  • New: Ability to import the taxonomies by module (Drupal 6 only)

1.50.0

  • Tested with WordPress 4.9.4

1.49.1

  • Fixed: Remove default Drupal prefix
  • Tweak: Use WP_IMPORTING
  • Tested with WordPress 4.9.2

1.48.0

  • New: Can import the Drupal databases stored on PostgreSQL
  • Tested with WordPress 4.9.1

1.47.2

  • Tested with WordPress 4.9

1.47.1

  • Fixed: SQL error when some taxonomies contain quotes

1.46.0

  • Fixed: Displayed a warning about the Localization module if there were disabled languages
  • Fixed: Displayed a warning about the Nodeblock module if the Field Collection module was used without the Nodeblock module

1.45.0

  • New: Can import the Drupal databases stored on SQLite

1.44.0

  • New: Check if we need the Forum add-on
  • Tested with WordPress 4.8.3

1.43.0

  • Fixed: [ERROR] Error:SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘config’ doesn’t exist

1.42.0

  • New: Check if we need the Entity Reference add-on (Drupal 8)

1.41.1

  • Fixed: Wrong images imported

1.41.0

  • Fixed: Sanitize the file names with spaces

1.40.0

  • New: Keep the images alignments
  • Tested with WordPress 4.8.2

1.39.0

  • New: Check if we need the Media Provider add-on

1.38.1

  • Fixed: Avoid double slash in the media filenames
  • Tweak: code refactoring

1.37.0

  • New: Check if we need the Entity Reference add-on
  • Fixed: Security cross-site scripting (XSS) vulnerability in the Ajax importer
  • Tested with WordPress 4.8.1

1.33.0

  • New: Import the image caption in the media attachment page

1.32.0

  • New: Check if the NodeBlock add-on is necessary

1.31.0

  • New: Check if we need the CCK add-on (Drupal 5)

1.28.0

  • New: Modify internal links in drafts

1.27.0

  • New: Block the import if the URL field is empty and if the media are not skipped
  • New: Add error messages and information

1.25.0

  • New: Add the percentage in the progress bar
  • New: Display the progress and the log when returning to the import page
  • Change: Restyling the progress bar
  • Fixed: Typo – replace “complete” by “completed”
  • Tested with WordPress 4.8

1.23.2

  • Fixed: Allow media src containing extra spaces
  • Tested with Drupal 5

1.23.1

  • Tested with WordPress 4.7.4

1.22.0

  • Tweak: Add a hook

1.19.0

  • New: Check if we need the Internationalization module
  • Tweak: Add some hooks for internationalization
  • Fixed: Images not imported on Drupal 8
  • Tested with WordPress 4.7.3

1.18.0

  • New: Migrates the Drupal 6 stories

1.17.0

  • New: Import the images stored on Amazon S3
  • New: Check if we need the Ubercart add-on

1.16.4

  • Fixed: Medias that are not in the standard /sites/default/files directory were not imported
  • Fixed: [ERROR] Error:SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘field_data_field_image’ doesn’t exist
  • Tested with WordPress 4.7.2

1.16.2

  • Fixed: Images not imported on some servers
  • Tested with WordPress 4.7.1

1.16.1

  • Tweak: Code refactoring

1.16.0

  • New: Import the images descriptions

1.15.1

  • Fixed: Existing images attached to imported posts were removed when deleting the imported data
  • Tested with WordPress 4.7

1.14.1

  • Fixed: Images not imported if there is no node summary

1.14.0

  • New: Can import taxonomies terms with a same name and a different parent
  • New: Check if the Name add-on is needed
  • New: Check if the Addressfield add-on is needed
  • Tweak: Taxonomies import speed increased

1.13.0

  • Fixed: Wrong progress bar color

1.12.3

  • Fixed: Notice: register_post_type was called incorrectly. Post type names must be between 1 and 20 characters in length.
  • Tweak: Add the fgd2wp_post_save_button_click hook
  • Tweak: Add the fgd2wp_post_import_taxonomies hook

1.12.2

  • Fixed: The progress bar didn’t move during the first import
  • Fixed: The log window was empty during the first import

1.12.0

  • Tweak: Add the fgd2wp_database_connection_successful hook

1.11.2

  • Fixed: The “IMPORT COMPLETE” message was still displayed when the import was run again

1.11.1

  • Fixed: The images protected by a user agent protection were not imported

1.11.0

  • New: Check if the Metatag add-on is needed
  • Fixed: Database passwords containing “<” were not accepted

1.10.1

  • Tweak: Code refactoring

1.10.0

  • New: Add a hook for Drupal 6 images
  • Tweak: Code refactoring

1.9.0

  • Fixed: Drupal 6 custom taxonomies containing spaces were not assigned to custom post types
  • Fixed: Drupal 6 terms which taxonomy contains spaces were not imported
  • Tweak: If the import is blocked, stop sending AJAX requests

1.8.1

  • Fixed: Notice: Undefined index: body_summary
  • Fixed: Notice: Undefined index: body_value

1.8.0

  • New: Authorize the connections to Web sites that use invalid SSL certificates

1.7.0

  • New: Check if the CCK add-on is needed
  • New: Check if the Location add-on is needed

1.6.0

  • New: Modify links like /node/xx and like /taxonomy/term/xx in the posts content

1.4.0

  • New: Test if the Drupal database contains some URL alias

1.3.2

  • Fixed: Drupal 6 nodes imported with a wrong revision

1.3.0

  • New: Test if the Drupal database contains some custom post types and custom taxonomies

1.2.0

  • New: Released a Premium version which migrates the comments and the users

1.1.1

  • FAQ created
  • Tested with WordPress 4.6.1

1.1.0

  • New: Compatible with Drupal 6

1.0.0

  • Initial version: Import Drupal articles, basic pages, categories, tags and images