You are here

README.txt in Entity Update 2.0.x

Same filename in this branch
  1. 2.0.x README.txt
  2. 2.0.x tests/README.txt
  3. 2.0.x tests/modules/entity_update_tests/README.txt
Same filename and directory in other branches
  1. 8 README.txt
Entity Update Module
--------------------
The main objective of the module Entity Update is to allow module developers
and site administrators to update entity types schema even if entities have data.
The update can be executed by drush command (recommended), from web browser
or Programmatically.
The module also allows you to view entity types list, entity types update status
and show the contents of an entity type.


CAUTION
- The entity update may damage your database, therefore backup the database
  before taking any action.
- For the production sites, please test twice on a non production site
  and put the site into maintain mode before any execution.
- If you plan to use this module, you should be conscious of what you are doing.
  You acknowledge that you are responsible for any issues due to this.



Installation
------------
Download via composer and install via drush (Recommended)
composer require drupal/entity_update
drush en entity_update -y

Download and install via drush
drush en entity_update -y


Similar modules
---------------
Devel Entity Updates (https://www.drupal.org/project/devel_entity_updates)
This module is similar to 'Entity Update' module except:
'Entity Update' module allows:
- Updating fields of entities having data
- Update from web interface
- View changes on the web interface
- View entity data quickly
... ...


Actions and Displays
--------------------

No need to configure the module, but you can check Entities update status via:
- Administration -> Configuration -> Development -> Entity Update.
- Link : /admin/config/development/entity-update.

Permission : Administer software updates


NEW in Version 2.0
------------------
- The version 2 is compatible from drupal 8.7 and drupal 9

Version 1.2
------------------
- Update a selected entity type.
Use the web browser for:
- View entity types list.
- View entity schema update status.
- View entities list.
- Run Entity update (Not recommended for production sites, use Drush).

Test module
-----------
The module provide a test module entity_update_tests with configurable fields.
Configuration : /admin/config/development/entity-update/tests


Documentation
-------------
- Documentation Home : https://www.drupal.org/docs/8/modules/entity-update
- See Entity Update from drush
    https://www.drupal.org/docs/8/modules/entity-update/entity-update-from-drush
- See Entity Update usage from web browser.
    https://www.drupal.org/docs/8/modules/entity-update/entity-update-usage-from-web-browser
- See Update entities programmatically.
    https://www.drupal.org/docs/8/modules/entity-update/update-entities-programmatically
- See Usage in production sites.
    https://www.drupal.org/docs/8/modules/entity-update/use-in-production-sites

Usage Examples : entity-update (Via drush)
------------------------------------------
Drush command : entity-update
Alias : upe

1. Show Entities to update
drush upe --show

2. Update Entities basic way.
This method is does not work if any of the entity contains data.
drush upe --basic

3. Update All Entities.
drush upe --all

4. Update without automatic database backup
   Not recommended for --all, suitable for --basic
drush upe --basic --nobackup

5. Create entities from entity backup database.
   If entity recreation failed (on drush upe --all), You can use this option to
   re create entities from entity backup database.
drush upe --rescue

6. Cleanup entity backup database
drush upe --clean

7. Install New Entity type after module installation.
drush upe ENTITY_TYPE_ID -y

Usage Examples : entity-check (Via drush)
----------------------------------------
This command allow to show entities and entity types via drush.
Drush command : entity-check
Alias : upec

1. Show The summery of an entity type.
drush upec node

2. Show all entity types contains "block".
drush upec block --types

3. Show 3 entities from 2 of the type 'node'.
drush upec node --list --start=2 --length=3

------------------- Advanced use --------------------
Update entity structure update or multiple operations
-----Developers Only - Not for Production sites.-----
-----------------------------------------------------
If you want to change the structure of an entity type (Example : make non
translatable entity to a translatable) and your entity has data, you can try
the following steps.
CAUTION :
- You must structure the entity before starting development.
- This type of operations must not be done on production sites.

1. Cleanup the backup data table.
drush upe --clean
2. Backup data of your entity.
drush upe ENTITY_TYPE_ID --bkpdel
3. Update the code (Entity type definitions for example).
UPDATE YOUR ENTITY TYPE STEP BY STEP (See the doc).
4. Update the entity type (No need to backup full database again).
drush upe ENTITY_TYPE_ID --nobackup
-> Note : You can use 'gunzip < backup_XXX.sql.gz | drush sqlc' if necessary.
5. Create entities from entity backup database once every things are success.
drush upe --rescue
6. Cleanup the backup data table once every things are success.
drush upe --clean

User case 1. make translatable entity to a non translatable
1. Remove 'translatable = TRUE,'
2. update entity
3. Remove language key Ex : '"langcode" = "langcode",'
4. Update entity

User case 2. make non translatable entity to a translatable
1. Add 'translatable = TRUE,'
2. Add language key Ex : '"langcode" = "langcode",'
3. Update entity

------------------ Thank you for using Entity Update Module. ------------------

File

README.txt
View source
  1. Entity Update Module
  2. --------------------
  3. The main objective of the module Entity Update is to allow module developers
  4. and site administrators to update entity types schema even if entities have data.
  5. The update can be executed by drush command (recommended), from web browser
  6. or Programmatically.
  7. The module also allows you to view entity types list, entity types update status
  8. and show the contents of an entity type.
  9. CAUTION
  10. - The entity update may damage your database, therefore backup the database
  11. before taking any action.
  12. - For the production sites, please test twice on a non production site
  13. and put the site into maintain mode before any execution.
  14. - If you plan to use this module, you should be conscious of what you are doing.
  15. You acknowledge that you are responsible for any issues due to this.
  16. Installation
  17. ------------
  18. Download via composer and install via drush (Recommended)
  19. composer require drupal/entity_update
  20. drush en entity_update -y
  21. Download and install via drush
  22. drush en entity_update -y
  23. Similar modules
  24. ---------------
  25. Devel Entity Updates (https://www.drupal.org/project/devel_entity_updates)
  26. This module is similar to 'Entity Update' module except:
  27. 'Entity Update' module allows:
  28. - Updating fields of entities having data
  29. - Update from web interface
  30. - View changes on the web interface
  31. - View entity data quickly
  32. ... ...
  33. Actions and Displays
  34. --------------------
  35. No need to configure the module, but you can check Entities update status via:
  36. - Administration -> Configuration -> Development -> Entity Update.
  37. - Link : /admin/config/development/entity-update.
  38. Permission : Administer software updates
  39. NEW in Version 2.0
  40. ------------------
  41. - The version 2 is compatible from drupal 8.7 and drupal 9
  42. Version 1.2
  43. ------------------
  44. - Update a selected entity type.
  45. Use the web browser for:
  46. - View entity types list.
  47. - View entity schema update status.
  48. - View entities list.
  49. - Run Entity update (Not recommended for production sites, use Drush).
  50. Test module
  51. -----------
  52. The module provide a test module entity_update_tests with configurable fields.
  53. Configuration : /admin/config/development/entity-update/tests
  54. Documentation
  55. -------------
  56. - Documentation Home : https://www.drupal.org/docs/8/modules/entity-update
  57. - See Entity Update from drush
  58. https://www.drupal.org/docs/8/modules/entity-update/entity-update-from-drush
  59. - See Entity Update usage from web browser.
  60. https://www.drupal.org/docs/8/modules/entity-update/entity-update-usage-from-web-browser
  61. - See Update entities programmatically.
  62. https://www.drupal.org/docs/8/modules/entity-update/update-entities-programmatically
  63. - See Usage in production sites.
  64. https://www.drupal.org/docs/8/modules/entity-update/use-in-production-sites
  65. Usage Examples : entity-update (Via drush)
  66. ------------------------------------------
  67. Drush command : entity-update
  68. Alias : upe
  69. 1. Show Entities to update
  70. drush upe --show
  71. 2. Update Entities basic way.
  72. This method is does not work if any of the entity contains data.
  73. drush upe --basic
  74. 3. Update All Entities.
  75. drush upe --all
  76. 4. Update without automatic database backup
  77. Not recommended for --all, suitable for --basic
  78. drush upe --basic --nobackup
  79. 5. Create entities from entity backup database.
  80. If entity recreation failed (on drush upe --all), You can use this option to
  81. re create entities from entity backup database.
  82. drush upe --rescue
  83. 6. Cleanup entity backup database
  84. drush upe --clean
  85. 7. Install New Entity type after module installation.
  86. drush upe ENTITY_TYPE_ID -y
  87. Usage Examples : entity-check (Via drush)
  88. ----------------------------------------
  89. This command allow to show entities and entity types via drush.
  90. Drush command : entity-check
  91. Alias : upec
  92. 1. Show The summery of an entity type.
  93. drush upec node
  94. 2. Show all entity types contains "block".
  95. drush upec block --types
  96. 3. Show 3 entities from 2 of the type 'node'.
  97. drush upec node --list --start=2 --length=3
  98. ------------------- Advanced use --------------------
  99. Update entity structure update or multiple operations
  100. -----Developers Only - Not for Production sites.-----
  101. -----------------------------------------------------
  102. If you want to change the structure of an entity type (Example : make non
  103. translatable entity to a translatable) and your entity has data, you can try
  104. the following steps.
  105. CAUTION :
  106. - You must structure the entity before starting development.
  107. - This type of operations must not be done on production sites.
  108. 1. Cleanup the backup data table.
  109. drush upe --clean
  110. 2. Backup data of your entity.
  111. drush upe ENTITY_TYPE_ID --bkpdel
  112. 3. Update the code (Entity type definitions for example).
  113. UPDATE YOUR ENTITY TYPE STEP BY STEP (See the doc).
  114. 4. Update the entity type (No need to backup full database again).
  115. drush upe ENTITY_TYPE_ID --nobackup
  116. -> Note : You can use 'gunzip < backup_XXX.sql.gz | drush sqlc' if necessary.
  117. 5. Create entities from entity backup database once every things are success.
  118. drush upe --rescue
  119. 6. Cleanup the backup data table once every things are success.
  120. drush upe --clean
  121. User case 1. make translatable entity to a non translatable
  122. 1. Remove 'translatable = TRUE,'
  123. 2. update entity
  124. 3. Remove language key Ex : '"langcode" = "langcode",'
  125. 4. Update entity
  126. User case 2. make non translatable entity to a translatable
  127. 1. Add 'translatable = TRUE,'
  128. 2. Add language key Ex : '"langcode" = "langcode",'
  129. 3. Update entity
  130. ------------------ Thank you for using Entity Update Module. ------------------