Skip to content

drupal db import

Paulo Maia Carvalho edited this page May 20, 2026 · 1 revision

drupal-db-import

Import a SQL dump into the Drupal database. Supports both .sql and .sql.gz files.

Usage

/drupal-db-import db-export-20240515.sql.gz
/drupal-db-import file=db-export-20240515.sql

If you don't provide a filename, the skill lists available dump files in /workspace/ and asks you to choose.

What it does

  1. Locates the dump file (absolute path or relative to /workspace/).
  2. Detects whether the file is gzip-compressed.
  3. Drops the current database contents (asks for confirmation).
  4. Imports via drush sql:cli or pipes through gunzip for .gz files.
  5. Runs drush cr after import.

Confirmation prompt

The skill always asks before dropping the existing database:

⚠ This will replace the current database. Continue? [y/N]

Notes

  • Requires the Docker stack to be running.
  • Large dumps (>500 MB) may take several minutes. The agent waits for completion.
  • If the import fails midway, the database may be in a partial state. Re-run the import to restore.

Related skills

Clone this wiki locally