0

After Upgrading from Drupal 8.6 to 8.7 I have tons of new (garbage?) tables in the database. The naming schema for the tables is old_XXXXXXtaxonomy_term__field_XXX

Is there a drush command to remove them or can i just drop dem directly?

I tried drush eval "field_purge_batch(5000)" and drush entity-updates without success.

  • The same happens for menu_link_content tables. it seems, that these are leftover tables when updating menus and taxonomies (as they are revisionable since 8.7) – gorie Jun 25 '19 at 13:47
  • As I found absolutely no functions which are referencing to these tables, I just deleted them. All went fine. – gorie Jul 3 '19 at 8:14
0

Not sure there is an automatic way to do this, a manual way would be to use:

echo "Show tables;" | drush @alias sql-cli | grep old > drop_tables.sql

Edit the tables.txt file and add drop table and a ; after each table name. Each line should look like:

drop table old_XXXXXXXtaxonomy_term__field_XXXX;

Backup you database in case Murphy come's around and do:

drush @alias sql-cli < drop_tables.sql

That will remove them from the DB.

Alternative way to do it via a GUI would be to use MySQL Workbench and drop them thru the interface.

|improve this answer|||||
  • thx for the reply. Deleting the tables is absolutely no problem. My main question is, if these tables are necessary in any way. – gorie Jun 26 '19 at 6:35
  • Drupal core and 99% of the contrib modules follow a pretty strict naming convention with the module owning the table used as a prefix. Unless you have a module named old that is creating these, you can drop them. But as with any major DB change, backup the database first. – CG Monroe Jun 26 '19 at 14:38
  • A module is not the reason. This happened during Update to 8.7. The old tables do not have the fields for revisioning, die "normal" have it. Looks like a internal "backup" if the migrations does not work. The question is: who makes the garbage collection? Me as a dev or drupal itself? – gorie Jun 27 '19 at 7:51
  • Actually, the original question was Is there a drush command to remove them or can i just drop dem directly? so this answer it. The question has never been Are those table necessary? so the answer cannot answer to that. – kiamlaluno Jul 3 '19 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.