Laravel Backup Example

This example repository shows, how to store Laravel backups on local storage, Google Drive, and Dropbox.

Video Tutorials

  1. Set up Automatic DB Backup in Laravel
  2. Store Automatic Laravel Backup On Google Drive
  3. Store Automatic Laravel Backup On Dropbox

How To Use This?

Download or clone this repo

$ git clone https://github.com/qirolab/laravel-backup-example.git

Install all dependency required by Laravel.

$ composer install

Generate app key, configure .env file and do migration.

# create copy of .env
$ cp .env.example .env

# create Laravel key
$ php artisan key:generate

# run migration
$ php artisan migrate

Configuration for Google drive

For Google drive backup, you need to provide these following variables in the .env file.

GOOGLE_DRIVE_CLIENT_ID=xxx.apps.googleusercontent.com
GOOGLE_DRIVE_CLIENT_SECRET=xxx
GOOGLE_DRIVE_REFRESH_TOKEN=xxx
GOOGLE_DRIVE_FOLDER_ID=null

To get the values for all these environment variables follow the steps mentioned this article:

Configuration for Dropbox

For Dropbox, add the following variable in the .env file.

DROPBOX_AUTH_TOKEN=xxx

Follow the steps on this article to get its value:

Take backups

php artisan backup:run