Drupal - Update a field type with hook_update()

As the error message says, this is not supported. There is no API that will do it for you.

There was a similar question recently but I can't find it right now, just this one: How do I change the type of a field attached to a content entity?

In short, you have two options:

  1. Create a new field, write a script to move over all your data, then delete the old field.
  2. Manually alter the database schema and low-level config data as well as the data that Drupal has stored about the field type and its schema. This is by far the more complicated option.

Tags:

8