This project is not covered by Drupal’s security advisory policy.
Synopsis
This module allows for any Flysystem filesystem to be used as a destination for Backup and Migrate files.
This module provides a custom Backup and Migrate Destination plugin ( FlysystemDestinationPlugin extends DestinationPluginBase) that updates most file write and directory operations with Flysystem API calls. Not all Flysystem filesystem adapters will make use of directories. File reads are still utilizing PHP's streams since Flysystem creates a PHP scheme out of each filesystem that is configured.
Requirements
- Backup and Migrate
- Flysystem
- A supported Flysystem adapter module:
Restrictions/Comments
S3, Backblaze, SFTP, and local schemes have been tested. Other Flysystem adapters should also work.
The Backup and Migrate Destination plugin that is implemented in this module makes use of BackupFileReadableInterface. This interface works because Flysystem filesystems/schemes become file streams in PHP. Future versions of this module may need to use only the native Flysystem API to work with more adapaters.
PLEASE test your backups in a safe environment before you rely on this for production backups.
Installation
- Enable the module.
- Enable supported Flysystem adapter module such as Flysystem - S3
- Configure a
$settings['flysystem']array with one or more valid Flysystem configurations. See examples below. - Clear and rebuild your cache
- Create a new Backup Destination in Backup and Migrate settings.
Example Configurations
These configurations go in your settings.php (or related files).
Amazon S3 Bucket
$settings['flysystem']['s3-example'] = [
'name' => 'S3 Example',
'driver' => 's3',
'config' => [
'key' => 'your_aws_key',
'secret' => 'your_aws_key_secret',
'region' => 'us-east-1',
'bucket' => 'bucket-name',
'protocol' => "https",
'cname_is_bucket' => FALSE,
'use_path_style_endpoint' => FALSE,
'public' => FALSE,
'prefix' => 'path/to/backups',
],
'cache' => TRUE,
];
Backblaze B2 Cloud Storage
// This array key can be changed as needed, it is how the module will
// identify this backup destination.
$settings['flysystem']['backblaze'] = [
// This must be set to "s3" and the Flysystem S3 module must also be
// installed.
'driver' => 's3',
'config' => [
// Set this to the "keyID" value from Backblaze.
'key' => 'MYKEYID',
// Set this to the "applicationKey" value from Backblaze.
'secret' => 'MYAPPLICATIONKEY',
// The name of the bucket created in Backblaze.
'bucket' => 'MYBUCKETNAME',
// This should be taken from the hostname provided by Backblaze; it
// might not need to be changed.
'region' => 'us-west',
// The hostname provided by Backblaze - make sure to prefix it with
// "https://" otherwise the backups won't work.
'endpoint' => 'https://s3.us-west-000.backblazeb2.com',
],
// Creates a metadata cache to speed up lookups.
'cache' => TRUE,
];
Project information
- Project categories: Administration tools, Developer tools, Integrations
- Ecosystem: Backup and Migrate
183 sites report using this module
- Created by jonmcl on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
