Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

No more 7.x to 8.x hook_update_N() -- file Migrate issues instead

At DrupalCon Prague, we decided not to provide a Drupal 7 to Drupal 8 upgrade path using the database update system, and to instead provide data migration using a Drupal 8 data migration API based on the Migrate module. As of today, Drupal 7 sites can no longer be upgraded to Drupal 8 with update.php, and all implementations of hook_update_N() have been removed from Drupal 8 core.

Going forward, hook_update_N() should only be included to provide 8.x to 8.x updates, once the 8.x to 8.x upgrade path is supported.

If your patch introduces a data model change that would previously have required a hook_update_N() implementation, consider instead whether a new or changed data migration is needed. Migration works by calling APIs, so most changes (for example entities) are covered already. But if your data change is not covered by an API (like changing a raw configuration object name or key) then you need to:

  1. Document the data model change in the issue and reference the core issue that introduces it under the "related issues" section.
  2. Update the summary of your main issue to indicate that the data model change has a corresponding Migrate issue.

If you are unsure whether new migration code is needed, file the issue anyway, and Migrate maintainers will review it and close it if it is not needed.

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web