Simple backup for database (MySQL, SQLite), active theme and CMS storages
GitHub clone into /plugins
dir:
git clone https://github.com/webula-cz/smallbackup
OctoberCMS backend (OC1)
Just look for 'Small Backup' in search field in:
Settings > Updates & Plugins > Install plugins
Settings > Administrators
You can set permissions to restrict access in Settings > Small plugins > Small Backup.
- Edit composer.json by adding new repository
"repositories": [
{
"type": "vcs",
"url": "https://github.com/webula-cz/smallbackup"
}
]
- run in command line
composer require webula/smallbackup-plugin
- Default backups folder
storage/app/backup
- Default cleanup interval
7 days
You can download created backups from plugin Settings tabs Database, Theme and Storage or you can get it directly from backup folder (eg. with FTP).
It's recommended to put your backup folder into .htaccess' Black listed folders, e.g. RewriteRule ^storage/app/backup/.* index.php [L,NC]
.
Must be allowed in plugin's Settings!
There are default scheduler jobs for database and active theme to be backed up once a day.
See October CMS docs about scheduling jobs.
If you cannot run Cron command directly on your server/hosting, you can create custom CMS page like this:
title = "artisan"
url = "/artisan/schedule"
is_hidden = 0
==
<?php
function onStart()
{
wsb_backup_db($once = false, $connectionName = null,$noCleanup = false);
wsb_backup_theme($once = false, $themeName = null, $noCleanup = false);
wsb_backup_storage($once = false, $cmsStorage = null, $noCleanup = false);
}
?>
==
You can create manual backup in plugin's Settings by clicking button Backup now
on Database or Theme tab.
There are console commands ready:
-
php artisan smallbackup:db [connectionName] [--no-cleanup] [--once]
(connectionName is optional and respect config/database.php settings) -
php artisan smallbackup:theme [themeName] [--no-cleanup] [--once]
(themeName is optional and can be any folder name in themes/) -
php artisan smallbackup:storage [cmsStorage] [--no-cleanup] [--once]
(cmsStorage is optional and can be any storage registered in cms.storage config)
Our thanks goes to: OctoberCMS team members and supporters for this great system. Brooke Cagle for his photo. Font Awesome for nice icons.
Created by Webula in Czech Republic.