Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Backup and Migrate: Flysystem

No security coverage Under active development 189 sites

This module allows Backup and Migrate to use any Flysystem-compatible storage, such as Amazon S3 or SFTP, as a destination for your backups. It integrates seamlessly by creating a custom destination plugin that utilizes Flysystem's API for file operations.

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

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,
    ];
Drupal 9–10 · not 11

Ask your assistant about Backup and Migrate: Flysystem

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
May 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
5.0.2 Stable 9–10 Nov 21, 2023
5.0.1 Stable 8–9 May 9, 2023