Steps:
- Implement update script to add new column term_full_entity_id and associated indexes T162533: Script for populating term_full_entity_id column in wb_terms table
- DBA to add new column term_full_entity_id (but possibly not yet the indexes) T162539: Deploy schema change for adding term_full_entity_id column to wb_terms table
- Switch to updating both, the old and the new column T167229: Change configuration of Wikidata in production to write term_full_entity_id, T165197: Change configuration of test Wikidata to write term_full_entity_id
- Populate new column using maintenance script: T171460: Populate term_full_entity_id on www.wikidata.org
- DBA to create new indexes using new column, if not already done when the column was created (needs lots of disk space)
- Switch to queries using the new column
- join against page and redirect table instead of wb_entity_per_page T162673: Adjust code reading from wb_terms table to use full entity ID
- make sure we are not using old and new indexes at once now, since they need a lot of RAM
- Switch off writing to the old column (this breaks compat for scripts on ToolLabs)
- remove term_entity_id from SQL files in Wikibase
- DBA to drop old column and indexes (free a lot of disk space)