Use in production sites
Last updated on
17 February 2023
Using this module in production sites need particular precautions.
For Site administrators and Webmasters
Normally you don't need to use this module on your sites in production. Anyway if you need to update an entity type schema you can do it.
- Make a backup of the site.
- Test twice locally.
- put the site into maintain mode.
- Update entity types one by one using
drush upe ENTITY_TYPE_ID
method.
Contrib Module developer
Steps to follow:
1. Add entity_update module as a dependencies to .info.yml file and composer.json file.
Examples:
.info.yml file
dependencies: - drupal:entity_update
composer.json
"require": { "drupal/entity_update": "^3.0" }
2. Use hook_update_N() to update your entity type.
Example :
$entity_type = \Drupal::entityTypeManager()->getStorage('THE_ENTITY_TYPE_ID'); $result = EntityUpdate::safeUpdateMain($entity_type->getEntityType());
Please follow this example : Update entities programmatically
Module : Entity Update
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion