Step 1: Convert to

Last updated on
27 January 2017

Before we begin replacing any code, we need to convert the module's .info file to a YAML file so Drupal 8 will recognize it. The easiest way to do this is by appending .yml to your .info file and converting the .info syntax to YAML syntax.

The change record provides a comprehensive overview for how to do this.

Once you've converted your .info file we'll check the extensions page in your website to make sure Drupal 8 successfully recognizes your module.

1. Rename your .info file


2. Convert your .info file to YAML

The structure is very similar, but there are a few differences. Here is an overview.

Drupal 7:
name = My D7 Module
description = This module needs to be ported to D8.
core = 7.x
version = VERSION
package = Custom Modules

configure = admin/config/user-interface/your-module

dependencies[] = ctools
dependencies[] = panels
dependencies[] = views

files[] = lib/FozzieClass.php
files[] = lib/GonzoClass.php
files[] = lib/KermitClass.php

Drupal 8:
name: 'My D7 Module'
description: 'This module needs to be ported to D8.'
core: 8.x
version: VERSION
package: 'Custom Modules'

configure: my_module.admin

  - ctools
  - panels
  - views

# Files are no longer listed in an .info file.

The change record to convert your .info file contains the full spec.

Check the Extensions Page

If you visit your Drupal 8 module administration page at admin/modules, your module should now be listed.

3. Enable your module

Once you've converted the file, reload admin/modules. You can use the new search field to locate your module:

Debugging .info.yml files

If the module is not listed correctly or cannot be enabled, see the troubleshooting tips for debugging .info.yml files.

Enable your module and start debugging!

Now, enable the module and see what happens! If you get a fatal error or white screen of death, try some of the common debugging techniques.