3

I installed a 'test' theme and then uninstalled it. I ran drush cache-rebuild and I also cleared all caches in the Configuration->Performance menu. However when I run drush config-export, to export my configuration from my development environment onto my staging environment, the list of files that get exported still include references to the 'test' theme even though I uninstalled it and cleared my caches.

I looked at my database and in the cachetags table there are rows there that reference the 'test' theme that I uninstalled. I have a feeling these are the ones that get exported during the drush config-export. Is there any way I can clear these?? Because right now I can't carry on with the drush config-import command on my staging environment because I get an error stating that it can't install the 'test' theme because it's not included. And it shouldn't install it because it shouldn't be there.

I've looked around and all documentation points to drush cache-rebuild being used to clear all caches, however in my case it's not doing it.

I'm using Drupal 8 along with Drush 8 all running on Ubuntu.

I was considering doing that but since I'm new to Drupal I was a little concerned that it will cause some other problems if I manually deleted them.
I just removed them and sure enough the config files are gone like they should've been. Everything looks fine so far.
It'd still be nice to know what is the proper way to have a theme removed, uninstalled and completely cleared from the database. And also what caches drush cache-rebuild really clears and what it doesn't.

3
  • I would truncate all cache tables and see what happens.
    – No Sssweat
    Mar 24, 2016 at 23:25
  • You can clear the cachetags table, but it has absolutely nothing to do with config import/export and will not fix whatever problem you have there.
    – Berdir
    Mar 25, 2016 at 8:24
  • It does have to do with it and it did fix it. config-export creates active configuration files so they can be exported onto another environment. If the current configuration still has reference to a theme that was suppose to be uninstalled, then the files will reflect it ( just like they were doing in my case). So in case anyone runs into this problem, removing the files from the cachetags table did in fact remove them also from the config-export files.
    – chavab_1
    Mar 25, 2016 at 18:27

1 Answer 1

5

To clear all cache tables run this command in your server terminal.

# Truncate cache tables in MySQL regardless of the active cache backend
echo "SHOW TABLES LIKE 'cache%'" | $(drush sql-connect) | tail -n +2 | xargs -L1 -I% echo "TRUNCATE TABLE %;" | $(drush sql-connect) -v

this will loop through all cache tables and truncate them in one command.

I can't remember the source and where I get this to give credit for the one who wrote it the first time.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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