Clone an existing site

You can clone an existing site, if the existing site has database and files backups. It is though important that you run the same drupal base, in this context, the same drupal image.

Example

apiVersion: ozzi.io/v1alpha2
kind: Drupal
metadata:
  name: cloned-drupal
  namespace: drupal-demo
spec:
  drupal_image: drupal:9.5.10-php8.2-apache
  mode: clone
  drupal_replicas: 1
  # New database for the cloned site (separate from the source)
  drupal_db: cloned_drupal
  drupal_db_username: cloned_user
  drupal_db_pass: "change-me-strong-pass"
  # Import database from a backup created by the source site
  drupal_database_backup_path: "backups/source-site/db.sql"
  # Import files from a backup created by the source site
  drupal_files_backup_path: "backups/source-site/files.tar.gz"
  # Admin user / password can be reset after import if you like
  drupal_user: admin
  drupal_password: "clone-admin-pass"
  drupal_reset_admin: true
  # Optional: enable automatic backups on the clone as well
  backup_db: true
  backup_files: true

After the deploy is done, you update the deployment, and remove the parts where you are importing, and you can also remove the drupal user and password, as you would, as a good practice reset this to something you don't have in code and store the new login in a secret storage.

apiVersion: ozzi.io/v1alpha2
kind: Drupal
metadata:
  name: cloned-drupal
  namespace: drupal-demo
spec:
  drupal_image: drupal:9.5.10-php8.2-apache
  drupal_replicas: 1
  # New database for the cloned site (separate from the source)
  drupal_db: cloned_drupal
  drupal_db_username: cloned_user
  drupal_db_pass: "change-me-strong-pass"
  backup_db: true
  backup_files: true