Skip to main content
MariaDB is a core sitectl service namespace. Operators use sitectl mariadb ... from any context whose project has a MariaDB-compatible service.

Backups

Export a SQL backup from the active context:
sitectl mariadb backup --output /tmp/site.sql.gz --gzip
sitectl mariadb backup appdb --output /tmp/appdb.sql.gz --gzip
Without a database argument, backup exports all databases. The command runs mariadb-dump or mysqldump inside the database service and reads the root password from /run/secrets/DB_ROOT_PASSWORD, MARIADB_ROOT_PASSWORD, or MYSQL_ROOT_PASSWORD. Use --service when a project uses a different database service name.

Restore

Import a SQL backup into the active context:
sitectl mariadb restore /tmp/site.sql.gz --yolo
sitectl mariadb restore /tmp/appdb.sql.gz appdb
Restore is destructive. Without --yolo, sitectl prompts before replacing the target database.

Sync

Sync a database artifact between two sitectl contexts:
sitectl mariadb sync --source production --target staging --database appdb
The sync flow reuses a recent source backup when possible, stages the artifact between contexts, and runs the same confirmed restore path on the target.

Inspection

Check the MariaDB container status:
sitectl mariadb status
Standalone MariaDB Compose projects may still exist, but the shared command surface belongs to core sitectl, not to a dedicated MariaDB CLI plugin.

Reference

backup

Export a MariaDB SQL backup from the active compose stack
sitectl mariadb backup [DATABASE]
FlagDefaultDescription
--all-databasesfalseExport all databases explicitly
--gzipfalseCompress the backup with gzip
-o, --outputWrite SQL backup to a host path instead of stdout
--servicemariadbMariaDB compose service name

restore

Import a MariaDB SQL backup into the active compose stack
sitectl mariadb restore INPUT [DATABASE]
Aliases: import
FlagDefaultDescription
--databaseDatabase to replace before import
--servicemariadbMariaDB compose service name
--yolofalseApply destructive database changes without confirmation

sync

Sync a MariaDB database artifact between contexts
sitectl mariadb sync
FlagDefaultDescription
--backup-dir/tmp/sitectl-mariadb-jobs/db-backupDirectory on the source host used to cache backup artifacts
--databaseDatabase to sync instead of all databases
--freshfalseAlways take a fresh backup instead of reusing one from today
--servicemariadbMariaDB compose service name
--sourceSource sitectl context
--targetTarget sitectl context
--yolofalseSkip the confirmation prompt before importing

status

Show the compose service container status
sitectl mariadb status
FlagDefaultDescription
--servicemariadbCompose service name