Klaus

Drupal sqlite vacuum

 Tue, 21 Nov 2017 16:20:37 +0100 
Drupal's sqlite backend is working surprisingly well. But then there is the moment when you realise that the database has grown to over 1GB and you need to VACUUM the sqlite database. I don't know why Drupal has it's own collation which makes it impossible to use system tools to work with the sqlite database.
sqlite3 sites/default/files/.ht.sqlite "VACUUM;"
Error: no such collation sequence: NOCASE_UTF8

After quite some time I finally found a rather simple solution and got the sqlite database to under 20MB again:
../bin/drush php-eval "db_query('vacuum;');"