This project is a command-line script that scans the source of a Drupal 7 module, flags any code that requires updating to Drupal 8, points off to any relevant API change notices, and (where possible) will actually attempt to convert the Drupal 7 code automatically to the Drupal 8 version! The goal is to hit the most widely-used Drupal hooks and ensure there's coverage for them. See the current battle plan.
Check out the latest demo video:
drush dl drupalmoduleupgrader cd modules/drupalmoduleupgrader composer install drush en drupalmoduleupgrader
- Place the Drupal 7 module you wish to port into your Drupal 8 site's /modules directory.
- To scan code and get a report of code that needs updating and how, run
the following inside the Drupal 8 root directory:
drush dmu-analyze MODULE_NAME
This will print a report showing any relevant change notices where you can
- To attempt to upgrade your Drupal 7 module's code to Drupal 8 automatically,
run the following inside the Drupal 8 root directory:
drush dmu-upgrade MODULE_NAME
The script will output a few lines as it attempts various conversions. Go into your modules/MODULE_NAME directory and check out all of your new YAML files and such. ;)
The code upgrade routines are implemented as a series of Drupal 8 plugins wrapped by a Drush extension and using Pharborist to do the code conversions. For information on how Drupal Module Upgrader works under the hood to help contribute sniffs and plugins, see the developer docs.
Drupal 8 is still undergoing active development, and introducing API changes between beta releases in order to fix critical bugs. As a result, Drupal Module Upgrader (DMU) releases work as follows:
- The latest stable release of DMU should be compatible with the latest beta/rc release of Drupal 8.
- DMU's -dev release chases the tip of the 8.0.x branch as much as possible.
Choose whichever release accommodates your Drupal 8 workflow: chasing betas/rcs or chasing HEAD. If DMU is not working as expected, please let us know.
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Developer
- Reported installs: 161 sites currently report using this module. View usage statistics.
- Downloads: 8,938
- Automated tests: Enabled
- Last modified: August 23, 2015
- Stable releases are covered by the security advisory policy.
Look for the shield icon below.