Install

Works with Drupal: ^8 || ^9 || ^10 || ^11 || ^12

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 206.29 KB
MD5: ece7deb780f4eb6e9559eb428077036f
SHA-1: 72455beaea7744b3a1cebfe6541a7e0d860b403b
SHA-256: 32ea78c16e7a656cf9e86f86cead667170820c0656f9e84d31f9c0e79b5a48ae
Download zip 218.27 KB
MD5: 43c45155f49e844f823ae38a17f05475
SHA-1: b2c748e46b8eeb8cb65117066dcf2457d819194b
SHA-256: b8d01a7eccbdf6b2aee7eee0de5cc76395b56f202d383817cdf062cbc5b09f1a

Release notes

First stable release of the 3.x branch. It brings the module from Drupal 8/9 to Drupal 10, 11 and 12, fixes optimization on sites with more than one database connection, and cleans up the stored configuration.

Requirements

  • Drupal core ^8 || ^9 || ^10 || ^11 || ^12
  • MySQL or PostgreSQL

Updating from 2.0.0 or an earlier 3.0.0 release candidate

  • Run database updates after deploying the code (drush updatedb). A post-update function removes unused keys from db_maintenance.settings, casts the boolean settings, and moves the legacy table_list_<database> keys into the nested table_list setting. The time of the last run is now kept in State instead of configuration.
  • Sites with more than one database connection: earlier releases ran the table listing and the OPTIMIZE / VACUUM statements on the default connection for every configured database. From this release they run on the database they are configured for. Additional databases may therefore be optimized for the first time. On MySQL, OPTIMIZE TABLE locks the table while it runs, so review the table selection and the time interval setting for those databases.
  • The "Log OPTIMIZE queries" setting is now honoured. Sites that had it switched off will stop getting log entries for each run.

New features

  • #2958533: Select database to optimize. Each database has its own "optimize all tables" option next to the per-table selection.

Bug fixes

  • #3597073: Queries for additional database connections ran on the default connection.
  • #3587961: OPTIMIZE queries logging does not honor setting to disable it.
  • #2993576: Cleanup config and improve schema.

Compatibility

  • #3597073: Drupal 12 compatibility. Integer fetch modes, which Drupal 12 rejects, are replaced with the FetchAs enum where it exists.
  • #3438284: Drupal 11 compatibility.
  • #3286921: Drupal 10 compatibility.

Under the hood

  • #3597073: hook_cron() and hook_help() are implemented in a hook class. The functions in db_maintenance.module remain as #[LegacyHook] wrappers for cores older than 11.1.
  • #3597073: First kernel tests, covering the hooks, table listing, an optimization run and a second database connection.
  • #3597074: GitLab CI enabled with the Drupal Association templates.
  • Removed the unused hook_permission() implementation and the uncalled CommonHookHandler::hookHelp() and CommonHookHandler::hookPermission() methods. The permission is still declared in db_maintenance.permissions.yml.
  • README rewritten, project logo added, coding standards fixes.

Changes since 3.0.0-rc6

  • #3597073: Drupal 12 compatibility, hook class, multi-database fix, kernel tests.
  • #3597074: GitLab CI.

Testing status

Developed and tested on Drupal 11.4 with PostgreSQL 18. Drupal 12 compatibility is based on an Upgrade Status scan and on the Drupal 12.0.x database API; please report problems found on Drupal 12 or on older core versions in the issue queue.

Created by: orkutmuratyilmaz
Created on: 8 Oct 2026 at 15:56 UTC
Last updated: 8 Oct 2026 at 15:56 UTC
Bug fixes
New features

Other releases