PHPackages                             levgenij/laravel-db-backup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. levgenij/laravel-db-backup

ActiveLibrary[File &amp; Storage](/categories/file-storage)

levgenij/laravel-db-backup
==========================

Backup and restore databases. Encrypting dumps. Save dumps to db and uploading to Dropbox. Restore dump from Dropbox.

1.0.4(7y ago)73.0k↓100%5MITPHPPHP &gt;=5.4.0

Since Dec 14Pushed 7y ago3 watchersCompare

[ Source](https://github.com/Levgenij/laravel-db-backup)[ Packagist](https://packagist.org/packages/levgenij/laravel-db-backup)[ RSS](/packages/levgenij-laravel-db-backup/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

laravel-db-backup
=================

[](#laravel-db-backup)

Based off of  with support for Laravel 5.\*.

Installation
------------

[](#installation)

Run composer command :

```
composer require wladmonax/laravel-db-backup
```

Or

Update your `composer.json` file to include this package as a dependency

```
"wladmonax/laravel-db-backup": "1.1.*",
```

Register the service provider by adding it to the providers array in the `config/app.php` file.

```
'providers' => array(
    'Witty\LaravelDbBackup\DBBackupServiceProvider'
)
```

or

```
'providers' => array(
    Witty\LaravelDbBackup\DBBackupServiceProvider::class
)
```

Run command to creating tables:

```
$ php artisan migrate
```

Configuration
=============

[](#configuration)

Copy the config file into your project by running

```
php artisan vendor:publish

```

This will generate a config file like this

```
return [

    // add a backup folder in the app/database/ or your dump folder
    'path' => app_path() . '/database/backup/',

    // add the path to the restore and backup command of mysql
    // this exemple is if your are using MAMP server on a mac
    // on windows: 'C:\\...\\mysql\\bin\\'
    // on linux: '/usr/bin/'
    // trailing slash is required
    'mysql' => [
        'dump_command_path' => '/Applications/MAMP/Library/bin/',
        'restore_command_path' => '/Applications/MAMP/Library/bin/',
    ],

    // s3 settings
    's3' => [
        'path'  => 'your/s3/dump/folder'
    ]

    //dropbox settings
    'dropbox' => [
        'accessToken' => DROPBOX_ACCESS_TOKEN,
        'appSecret' => DROPBOX_APP_SECRET,
        'prefix' => DROPBOX_PREFIX, //this is name of your dropbox folder
    ],

    //encrypt settings
    'encrypt' => [
        'key' => ENCRYPT_KEY
    ],
    // Use GZIP compression
    'compress' => false,
];
```

**All settings are optional and have reasonable default values.**

Usage
-----

[](#usage)

#### Backup

[](#backup)

Creates a dump file in `app/storage/dumps`

```
$ php artisan db:backup
```

###### Use specific database

[](#use-specific-database)

```
$ php artisan db:backup --database=mysql
```

###### Need ecnrypt db

[](#need-ecnrypt-db)

```
$ php artisan db:backup --encrypt
```

###### Save dump to dropbox

[](#save-dump-to-dropbox)

```
$ php artisan db:backup --dropbox
```

###### You can merge options like this

[](#you-can-merge-options-like-this)

```
$ php artisan db:backup --dropbox --encrypt
```

###### Upload to AWS S3

[](#upload-to-aws-s3)

```
$ php artisan db:backup --upload-s3 your-bucket
```

You can use the `--keep-only-s3` option if you don't want to keep a local copy of the SQL dump.

Uses the [aws/aws-sdk-php-laravel](https://github.com/aws/aws-sdk-php-laravel) package which needs to be [configured](https://github.com/aws/aws-sdk-php-laravel#configuration).
Uses the [spatie/flysystem-dropbox](https://github.com/spatie/flysystem-dropbox) package.

#### Restore

[](#restore)

Paths are relative to the app/storage/dumps folder.

###### Restore a dump

[](#restore-a-dump)

```
$ php artisan db:restore dump.sql
```

###### Restore from last backup dump

[](#restore-from-last-backup-dump)

```
$ php artisan db:restore --last-dump
```

###### Restore from Dropbox

[](#restore-from-dropbox)

```
$ php artisan db:restore --dropbox-dump=filename.sql
```

###### Restore from Dropbox last dump

[](#restore-from-dropbox-last-dump)

```
$ php artisan db:restore --dropbox-last-dump
```

###### List dumps

[](#list-dumps)

```
$ php artisan db:restore
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~163 days

Total

5

Last Release

2779d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2e568c7b06cb34cb86c327e0ebc10135196490641e03c608d24cdfef787452e?d=identicon)[Levgenij](/maintainers/Levgenij)

---

Top Contributors

[![Levgenij](https://avatars.githubusercontent.com/u/16118509?v=4)](https://github.com/Levgenij "Levgenij (9 commits)")[![wladmonax](https://avatars.githubusercontent.com/u/36949716?v=4)](https://github.com/wladmonax "wladmonax (8 commits)")[![larkinwhitaker](https://avatars.githubusercontent.com/u/9460109?v=4)](https://github.com/larkinwhitaker "larkinwhitaker (6 commits)")

### Embed Badge

![Health badge](/badges/levgenij-laravel-db-backup/health.svg)

```
[![Health](https://phpackages.com/badges/levgenij-laravel-db-backup/health.svg)](https://phpackages.com/packages/levgenij-laravel-db-backup)
```

###  Alternatives

[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[stechstudio/laravel-zipstream

A fast and simple streaming zip file downloader for Laravel.

4633.7M3](/packages/stechstudio-laravel-zipstream)[spatie/laravel-google-cloud-storage

Google Cloud Storage filesystem driver for Laravel

2408.9M13](/packages/spatie-laravel-google-cloud-storage)[azure-oss/storage-blob-laravel

Azure Storage Blob filesystem driver for Laravel

63582.2k1](/packages/azure-oss-storage-blob-laravel)[spatie/laravel-backup-server

Backup multiple applications

17016.7k1](/packages/spatie-laravel-backup-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
