Mode

The mode field is a high-level switch that tells the Drupal Operator how to create and initialize your site. It helps you choose between:

  • Creating a new site
  • Cloning an existing site from backups
  • Using an external database instead of the operator’s MariaDB

You set it in the spec of your Drupal resource:

spec:
  mode: standard | clone | external-db

If you don’t set mode, it behaves like standard by default.

Modes overview

1. mode: standard (fresh site)

Use this when you want a brand new Drupal site:

  • The operator runs a Drupal site-install.
  • It creates a MariaDB instance (unless you explicitly disable it).
  • No database or files are imported.

Example:

spec:
  mode: standard
  drupal_image: drupal:9.5.10-php8.2-apache
  drupal_user: admin
  drupal_password: "change-me"
  drupal_db: my_new_site
  drupal_db_username: my_new_site
  drupal_db_pass: "db-pass"

2. mode: clone (clone from backups)

Use this when you want to clone an existing site from its backups:

  • The operator does not run site-install.
  • It imports:
    • A database dump (DB backup).
    • A files archive (files backup).

You must point to the backup files (paths must exist inside the import jobs):

spec:
  mode: clone
  drupal_database_backup_path: "/backups/source-site/db.sql"
  drupal_files_backup_path: "/backups/source-site/files.tar.gz"

This is ideal for:

  • Creating a staging site from production.
  • Copying a site into another site.

3. mode: external-db

Use this when you want Drupal to use an external database:

  • The operator does not create MariaDB.
  • You configure the external DB connection.
  • You can decide whether to:
  • Run a fresh install on that DB, or
  • Import from a backup into that DB.

Example (simple fresh install on external DB):

spec:
  mode: external-db
  drupal_db: drupal_prod
  drupal_db_username: drupal_user
  drupal_db_pass: "use-a-secret-here"

Summary

  • Use mode: standard for a brand new site.
  • Use mode: clone to create a copy from DB/files backups.
  • Use mode: external-db when your DB is managed outside the operator.

For deeper details and implementation behavior, see: