jimbojsb / db-snapshot
Snapshot your database with mysqldump and store it to a an asset volume (S3). Also restore it from that same location. Great for local dev snapshots and nightly backups.
Installs: 2 890
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 3
Forks: 6
Type:craft-plugin
Requires
- craftcms/cms: ^3.0.0-RC1
- league/flysystem-aws-s3-v3: ^1.0
This package is auto-updated.
Last update: 2024-11-30 01:56:55 UTC
README
Store Craft CMS database backups in an S3 (or compatible) bucket. Also supports loading those backups for local development, etc.
Requirements
This plugin requires Craft CMS 3.x and an S3-compatible storage account.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require jimbojsb/db-snapshot
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for DB Snapshot.
Configuring DB Snapshot
Configuration is supported in the Craft admin panel.
Snapshot filename can contain Twig expressions: db_snapshot_{{now|date("Ymd-His")}}.sql
All fields support Craft environment variable references (For example, setting Access Key to $ACCESS_KEY
)
Be aware that if you use a timestamp in the filename, you will need to provide a filename when using the load action.
Using DB Snapshot
# create a new snapshot
./craft db-snapshot/snapshot/create
# load an existing snapshot
./craft db-snapshot/snapshot/load
# load an existing snapshot (specific filename if using variables)
./craft db-snapshot/snapshot/load --filename=db_snapshot_2020-02-29-123456.sql
# list available snapshots
./craft db-snapshot/snapshot/list
Brought to you by Josh butts