Git Product home page Git Product logo

strapi-plugin-backup's Introduction

Strapi Plugin Backup

Automate the backup of uploads and database to the cloud.

Features

  • Database backup
  • Uploads files backup
  • Cleanup of backups

Installation

npm install strapi-plugin-backup

Configuration

Please see documentation for more information about configuration.

Example

// ./config/plugins.js

module.exports = ({env}) => {
  return ({
    // ...
    backup: {
      enabled: true,
      config: {
        cronSchedule: '0 9-17 * * *', // At minute 0 past every hour from 9 through 17
        storageService: 'aws-s3',
        awsAccessKeyId: '<AWS_ACCESS_KEY_ID>',
        awsSecretAccessKey: '<AWS_SECRET_ACCESS_KEY>',
        awsRegion: '<AWS_REGION>',
        awsS3Bucket: '<AWS_S3_BUCKET>',
        databaseDriver: env('DATABASE_CLIENT'),
        mysqldumpExecutable: '/path/to/your/mysqldump/bin',
        mysqldumpOptions: [
          '--add-drop-table',
          '--extended-insert',
          '--lock-tables',
          '--dump-date'
        ],
        allowCleanup: true,
        timeToKeepBackupsInSeconds: 172800, // 2 days
        cleanupCronSchedule: '0 9 * * *', // Each day at 09:00 AM
        errorHandler: (error, strapi) => {
          console.log(error);
        },
      }
    },
    // ...
  })
};

Releases

This project follows the Semantic Versioning convention (https://semver.org) for version numbering.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

Please see License File for more information.

strapi-plugin-backup's People

Contributors

adebayohountondji avatar thomas-leidinger avatar

Stargazers

Max Veerapat Kumchom avatar Romain Metayer avatar  avatar Yunior González Santana avatar

Watchers

Fab Lab avatar Romain Metayer avatar  avatar

Forkers

deepskill

strapi-plugin-backup's Issues

Add support for Node 20

When installing the strapi backup plugin, the following error pops up:

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=14.19.1 <=18.x.x". Got "20.9.0"
error Found incompatible module.

Since Node 20 entered LTS in October, I think it's safe to include in a release.

Error with strapi-plugin-backup using SQLite database on local project

I have tried to use sqlite default db on strapi local project before deploy to the cloud and also the strapi-plugin-backup strapi plugin for backup my DB to aws s3 bucket. The issue is, what is the suitable value for "sqlite3Executable" ??.

I have tried so many types of values as path and file names. But its getting me error like this. "is not recognized as an internal or external command".

When we use default database as sqlite for the newly created strapi project its creating a db in file we configure as data.db file inside .tmp directory. I just given that path to the backup plugin and its not working. And also in the document and the github repository descriptions also have no any explanation for this and could you please send me some solution for this one.

This is my strapi dtabase.js file

const path = require("path");

module.exports = ({ env }) => {
  const client = env("DATABASE_CLIENT", "sqlite");

  const connections = {
    sqlite: {
      connection: {
        filename: path.join(
          __dirname,
          "..",
          env("DATABASE_FILENAME", ".tmp/data.db")
        ),
      },
      useNullAsDefault: true,
    },
  };

  return {
    connection: {
      client,
      ...connections[client],
      acquireConnectionTimeout: env.int("DATABASE_CONNECTION_TIMEOUT", 60000),
    },
  };
};

This is the code I have used for backup plugin configuration

const path = require("path");

module.exports = ({ env }) => ({
  backup: {
    enabled: true,
    config: {
      cronSchedule: "* 9-17 * * *",
      storageService: "aws-s3",
      awsAccessKeyId: "*******************",
      awsSecretAccessKey: "*******************",
      awsRegion: "*******************",
      awsS3Bucket: "*******************",
      databaseDriver: env("DATABASE_CLIENT"),
      sqlite3Executable: path.resolve(__dirname, "..", ".tmp"),
      allowCleanup: true,
      timeToKeepBackupsInSeconds: 172800,
      cleanupCronSchedule: "0 9 * * *",
    },
  },
});

Add support for S3 compatible storage providers

Hello, is it possible to include the endpoint configuration option to enable other S3 compatible storage providers such as Backblaze?
This was implemented in the S3 media storage plugin, which can be found at https://github.com/strapi/strapi/blob/3b504a5284f4e0eeaec73af89fc7c1604a953214/packages/providers/upload-aws-s3/src/index.ts#L39.

You can also find documentation regarding this feature at https://market.strapi.io/providers/@strapi-provider-upload-aws-s3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.