Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Smart DB Tools

Security covered Under active development

This module enhances the database dumping tool by allowing you to export database tables into individual PHP files. It also provides options to split large tables into smaller files to reduce memory usage during export and import, making it easier to manage and maintain database migration fixtures.

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
Drupal 10–11

Ask your assistant about Smart DB Tools

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Aug 2024
Latest release
2 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.2.0 Stable 10–11 Jul 19, 2026
1.1.0 Stable 10–11 Dec 9, 2025
1.0.0 Stable 10–11 Aug 26, 2024