Add options to limit tables, exclude data, or only export data to DbDumpCommand

Created on 4 August 2015, almost 9 years ago
Updated 31 January 2023, over 1 year ago

Problem/Motivation

Currently, the core/scripts/dump-database-d8-mysql.php script takes no options, and dumps everything aside from a few excluded tables, and some data (eg cache tables) are excluded.

When working on tests for #2544954: SqlContentEntityStorageSchema does not detect column-level schema changes in non-base-fields → , it will be very nice to be able to say only export data for these certain tables (then the test can load an additional file that doesn't include the table create statement). Similarly, only exporting schema for a list of tables will also be useful.

This is by no means urgent, as this can be done by hand currently, but it would be nice DX for future upgrade path issues.

Proposed resolution

Add --schema-only and --data-only options, and an optional tables argument.

The new command could, for instance, export just the node and node_field_data insert statements using:

./dump-database-d8-mysql.php --data-only node node_field_data

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

10.1 ✨

Component
Database update  →

Last updated 4 days ago

No maintainer
Created by

🇺🇸United States jhedstrom Portland, OR

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024