Drupal Module
Backup module for Drupal 9, 10, and 11. Export your database, public/private files, and site configuration.
Requirements
- Drupal 9.0, 10.0, or 11.0+
- PHP 8.0 or higher
- Composer for installation
- LOX API key
Installation
Option 1: Manual Installation
- Download and extract
Extract the module to
modules/contrib/lox_backup - Enable the module
drush en lox_backup
- Configure settings
Go to
Configuration → System → LOX Backup
Option 2: Via Admin UI
- Navigate to Extend
Go to
Extend → + Install new module - Upload the module
Upload the zip file or paste the URL
- Enable and configure
Check "LOX Backup" and click Install
Configuration
API Settings
| Setting | Description |
|---|---|
| API Key | Your LOX API key from backlox.com |
| API URL | Default: https://backlox.com/api |
Backup Components
| Component | Description | Path |
|---|---|---|
| Database | All Drupal tables | database.sql |
| Public Files | Uploaded files, images | sites/default/files |
| Private Files | Private file storage | private:// |
| Configuration | Site configuration YAML | config/*.yml |
Scheduled Backups
The module uses Drupal's cron system. Configure your server to run Drupal cron:
# Run cron every hour 0 * * * * cd /var/www/drupal && drush cron # Or use wget 0 * * * * wget -O - -q "https://your-site.com/cron/YOUR_CRON_KEY"
The module checks the schedule setting on each cron run and triggers a backup when due.
Drush Commands
The module provides Drush commands for command-line backup management:
# Run a backup drush lox:backup # Test connection drush lox:test # List recent backups drush lox:list # Show backup status drush lox:status
Coming Soon
Drush commands will be available in the next release.
Permissions
The module provides one permission:
- Administer LOX Backup - Required to configure settings and run backups. Typically assigned to the Administrator role.
Backup Structure
drupal-mysite-20240115_030000.tar.gz
├── database.sql # Full database dump
├── files/ # Public files (sites/default/files)
├── private/ # Private files (if configured)
└── config/ # Configuration export
├── system.site.yml
├── user.role.*.yml
├── views.view.*.yml
└── ... (all config)Restoring from Backup
- Download and extract the backup
Get the backup from the LOX dashboard and extract the tar.gz file.
- Restore the database
drush sql:cli < database.sql
- Restore files
Copy the files directory to sites/default/files
- Import configuration
drush config:import --source=/path/to/config
- Clear caches
drush cr
PULL Mode (New in v1.3.0)
New Feature: Server-Initiated Backups
PULL mode allows LOX to initiate backups remotely, providing centralized scheduling, better reliability, and active monitoring of your Drupal sites.
Enabling PULL Mode
- Go to LOX Backup settings
Navigate to Configuration → System → LOX Backup → PULL tab.
- Enable PULL mode
Toggle "Enable PULL Backups" to generate a secure token.
- Register site in LOX dashboard
Add your site URL and PULL token in the LOX dashboard under CMS Sites.
PULL API Endpoints
POST /lox/pull/backup # Trigger backup generation GET /lox/pull/status # Get site status and sizes GET /lox/pull/download # Download generated backup POST /lox/pull/token/refresh # Regenerate PULL token
Troubleshooting
Private files not backing up
Ensure private file path is configured in settings.php and the path is readable by the web server.
Scheduled backups not running
Verify cron is running properly. Check Reports → Recent log messagesfor cron-related errors.