db:restore
Restore a MariaDB database from a SQL dump file.
Usage
splent db:restore FILENAME [--yes]
| Argument | Description |
|---|---|
FILENAME |
Path to the .sql dump file to restore. |
Examples
Restore with confirmation prompt:
splent db:restore dump_20250101_120000.sql
Restore without prompting (e.g. in CI):
splent db:restore dump_20250101_120000.sql --yes
Options
| Option | Description |
|---|---|
--yes |
Skip the confirmation prompt. |
Description
Reads connection credentials from the workspace .env file (MARIADB_HOSTNAME, MARIADB_USER, MARIADB_PASSWORD, MARIADB_DATABASE) and imports the given SQL file into the active database.
Unless --yes is passed, the command asks for confirmation before proceeding, since the operation overwrites all existing data.
This operation is destructive. All existing data in the target database will be replaced by the contents of the dump file. Consider running db:dump first to back up the current state.
Pairs with db:dump:
splent db:dump # export
splent db:restore dump_20250101_120000.sql # import