Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

Smart DB Tools is a module🤔 which implements the feature requested in #3213633: Improve DX of maintaining migration database fixtures: provide an option for creating per-table database fixtures in DbDumpcommand.

It contains an enhanced version of the DbToolsApplication of Drupal core with an improved dump command that allows users to save a database dump into multiple PHP scripts – so each database table will be exported in its own file.

This functionality greatly reduces the time spent on cleaning changed database fixture scripts.

Usage

The application is backward-compatible with the DbToolsApplication in Drupal core. The only difference is that if the --split-destination option is passed to the script, then instead of a single file, per-table database PHP scripts will be generated. The value of the --split-destination option is the name of the main PHP database dump file.

To lower memory consumption (both on export and import), tables with more than 1000 records are also exported into multiple files (this is by default). This option can be changed by providing a --subsplit-limit option set to the desired value. Using --subsplit-limit 1000 works well with PHP memory_limit set to 256M. Setting this limit to a number lower than 1 disables this behavior.

Example

php modules/contrib/smart_db_tools/scripts/smart-db-tools.php dump\
 --database fixture_connection\
 --subsplit-limit 5000\
 --split-destination modules/custom/db-dump.php

Activity

Total releases
1
First release
Dec 2025
Latest release
4 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.1.0 Stable Dec 9, 2025