Database-Schema

Database Schema

MokoSuiteBackup uses 4 database tables, all prefixed with #__mokosuitebackup_.

Tables Overview

Table Purpose
#__mokosuitebackup_profiles Backup profile configurations
#__mokosuitebackup_records Backup execution history and metadata
#__mokosuitebackup_snapshots Content snapshot records
#__mokosuitebackup_remotes Multi-remote storage destinations per profile

#__mokosuitebackup_profiles

Stores backup profile configurations. Each profile defines backup type, archive settings, exclusions, remote storage, encryption, sanitization, notification, and retention settings.

Column Type Default Description
id INT UNSIGNED PK AI Profile ID
title VARCHAR(255) '' Profile name
description TEXT Optional notes
backup_type VARCHAR(20) 'full' full, database, files
archive_format VARCHAR(10) 'zip' zip, tar.gz, 7z
compression_level TINYINT UNSIGNED 5 0=none, 9=max
split_size INT UNSIGNED 0 0=no split, otherwise MB per part
backup_dir VARCHAR(512) '[DEFAULT_DIR]' Backup output directory (supports placeholders)
archive_name_format VARCHAR(512) '[HOST]_[DATETIME]_profile[PROFILE_ID]' Filename format with placeholders
exclude_dirs TEXT Newline-separated directory paths to exclude
exclude_files TEXT Newline-separated filename patterns to exclude
exclude_tables TEXT Newline-separated table names to exclude
remote_storage VARCHAR(20) 'none' Legacy: none, ftp, google_drive, s3
ftp_host, ftp_port, ftp_username, ftp_password, ftp_path, ftp_passive, ftp_ssl various FTP/FTPS connection settings
sftp_host, sftp_port, sftp_username, sftp_auth_type, sftp_password, sftp_key_data, sftp_passphrase, sftp_path various SFTP connection settings (key stored base64)
gdrive_client_id, gdrive_client_secret, gdrive_refresh_token, gdrive_folder_id VARCHAR Google Drive OAuth2 credentials
s3_endpoint, s3_region, s3_access_key, s3_secret_key, s3_bucket, s3_path VARCHAR S3/S3-compatible settings
remote_keep_local TINYINT 1 Keep local copy after remote upload
encryption_password VARCHAR(255) '' AES-256 archive encryption password
include_mokorestore VARCHAR(20) '0' 0=none, 1=wrapped, standalone
restore_script_name VARCHAR(100) 'restore.php' Custom restore script filename
sanitize_passwords TINYINT 0 Replace user password hashes
preserve_super_admin TINYINT 1 Keep super admin password when sanitizing
sanitize_emails TINYINT 0 Replace user emails with dummy values
sanitize_sessions TINYINT 1 Skip session table data
notify_email VARCHAR(512) '' Comma-separated notification emails
notify_user_groups VARCHAR(255) '' Comma-separated Joomla user group IDs
notify_on_success TINYINT 0 Notify on successful backup
notify_on_failure TINYINT 1 Notify on failed backup
retention_days INT 0 Per-profile retention days (0=use global)
retention_count INT 0 Per-profile retention count (0=use global)
ntfy_topic VARCHAR(255) '' ntfy push notification topic
ntfy_server VARCHAR(512) 'https://ntfy.sh' ntfy server URL
ntfy_token VARCHAR(255) '' ntfy access token
published TINYINT 1 Published state
created DATETIME Created timestamp
modified DATETIME Last modified timestamp

Indexes: idx_published

A default profile (ID 1) is inserted on install with sensible defaults.


#__mokosuitebackup_records

Stores a record for each backup execution with status, file metadata, and log.

Column Type Default Description
id INT UNSIGNED PK AI Record ID
profile_id INT UNSIGNED 1 FK → profiles.id
description VARCHAR(255) '' Backup description
status VARCHAR(20) 'pending' pending, running, complete, fail
origin VARCHAR(20) 'backend' backend, cli, api, scheduled
backup_type VARCHAR(20) 'full' full, database, files
archivename VARCHAR(512) '' Archive filename
absolute_path VARCHAR(1024) '' Full filesystem path to archive
total_size BIGINT UNSIGNED 0 Archive size in bytes
db_size BIGINT UNSIGNED 0 Database dump size in bytes
files_count INT UNSIGNED 0 Number of files backed up
tables_count INT UNSIGNED 0 Number of tables dumped
multipart INT UNSIGNED 0 Number of split parts (0=single)
tag VARCHAR(50) '' Optional tag for categorization
backupstart DATETIME Backup start time
backupend DATETIME Backup end time
filesexist TINYINT 1 Whether archive file exists on disk
remote_filename VARCHAR(512) '' Filename on remote storage
checksum VARCHAR(64) '' SHA-256 hash of archive
base_record_id INT UNSIGNED 0 Base full backup ID for differential
manifest LONGTEXT NULL JSON file manifest for differential comparison
log MEDIUMTEXT NULL Step-by-step backup log

Indexes: idx_profile, idx_status, idx_backupstart


#__mokosuitebackup_snapshots

Stores content snapshot metadata (the actual content data is in a JSON file on disk).

Column Type Default Description
id INT UNSIGNED PK AI Snapshot ID
description VARCHAR(255) '' Snapshot description
content_types VARCHAR(255) '[]' JSON array: ["articles","categories","modules"]
status VARCHAR(20) 'complete' complete, fail
articles_count INT UNSIGNED 0 Number of articles captured
categories_count INT UNSIGNED 0 Number of categories captured
modules_count INT UNSIGNED 0 Number of modules captured
data_file VARCHAR(512) '' Absolute path to JSON snapshot file
data_size BIGINT UNSIGNED 0 Size of JSON file in bytes
log MEDIUMTEXT NULL Snapshot operation log
created DATETIME Created timestamp
created_by INT UNSIGNED 0 User ID who created the snapshot

Indexes: idx_created


#__mokosuitebackup_remotes

Stores multiple remote storage destinations per backup profile (multi-remote support).

Column Type Default Description
id INT UNSIGNED PK AI Remote destination ID
profile_id INT UNSIGNED FK → profiles.id
title VARCHAR(255) '' Destination display name
type VARCHAR(20) 'sftp' sftp, s3, google_drive
enabled TINYINT 1 Whether this destination is active
params MEDIUMTEXT JSON: type-specific connection settings
ordering INT 0 Display/execution order
created DATETIME Created timestamp
modified DATETIME Last modified timestamp

Indexes: idx_profile, idx_enabled (composite: profile_id + enabled)

Relationships

profiles (1) ──→ (N) records        Profile has many backup records
profiles (1) ──→ (N) remotes         Profile has many remote destinations
records.base_record_id ──→ records   Differential backup references base full backup

Printed from wiki · Database-Schema