Change record status: 
Introduced in branch: 
Introduced in version: 

In Drupal 7 or earlier, we used hook_update_N() for all upgrades including major version upgrades like Drupal 6 to Drupal 7. In Drupal 8, we still use hook_update_N() for minor upgrades that stay on Drupal 8 (ie. 8.x to 8.x upgrades). But for major version upgrades (like Drupal 7 to Drupal 8) you will need to write a migration with the Migration API. Without reading this introduction page (just the page, not the children, is enough) this change notice will be very hard to understand.

Variable - to - config upgrade, D7-style

function system_update_8009() {
update_variables_to_config('system.cron', array(
'cron_safe_threshold' => 'threshold.autorun',
'cron_threshold_warning' => 'threshold.requirements_warning',
'cron_threshold_error' => 'threshold.requirements_error',

Variable - to config migration

You need to create a migration configuration entity which specifies the following:

  1. The source is provided by the Drupal variable plugin. This plugin, somewhat unusually, requires much configuration, namely the list of variables to be read. Most source plugins provided by the Migrate Drupal just provide one source row per SQL table row without much configuration.
  2. How each configuration key is created from the source. To understand this particular example better, reading the process introduction at is recommended.
  3. The results should be saved into a configuration file. The config destination plugin requires little configuration: just the name of the configuration file. Other common destinations are entities, like entity:node.

Putting this all together we get migrate.migration.d6_system_cron.yml:

id: d6_system_cron
  plugin: variable
    - cron_threshold_warning
    - cron_threshold_error
    - cron_last
  'threshold:warning': cron_threshold_warning
  'threshold:error': cron_threshold_error
  plugin: config
  config_name: system.cron
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other updates done