PHPackages                             salvatorecervone/backup-database - 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. salvatorecervone/backup-database

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

salvatorecervone/backup-database
================================

This package manage backup-database

2.0.7(5mo ago)188[2 PRs](https://github.com/SalvatoreCervone/backup-database/pulls)MITPHPPHP ^8.3CI failing

Since Apr 8Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/SalvatoreCervone/backup-database)[ Packagist](https://packagist.org/packages/salvatorecervone/backup-database)[ Docs](https://github.com/SalvatoreCervone/backup-database)[ GitHub Sponsors](https://github.com/SalvatoreCervone)[ RSS](/packages/salvatorecervone-backup-database/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (8)Versions (23)Used By (0)

LARAVEL BACKUP-DATABASE
=======================

[](#laravel-backup-database)

[![laravel backup database](https://github.com/SalvatoreCervone/backup-database/raw/main/images/backup-database.jpeg)](https://github.com/SalvatoreCervone/backup-database/blob/main/images/backup-database.jpeg)

BETA FOR BACKUP DATABASE
------------------------

[](#beta-for-backup-database)

Important

Actually V1 used for only backup MSSQL Database with Driver Sqlsrv

- MSSQL
- MySQL
- MongoDB

1 or more Database
------------------

[](#1-or-more-database)

You can backup one or more database in single operation. In config file you add connection name of you single or multi database and send backup. Example of single:

```
 'listconnections' => [
        [
            'connection' => env('DB_CONNECTION'),
            'daily' => false,
            'datetimeFormat' => 'Y-m-d H:i',
            'destinationpath' => 'c:\tmp\\',
            'days_for_delete' => 1,
            'soft_delete' => false
        ]
    ],

```

The backup config, for default, read DB\_CONNECTION of your env file. From you connection name read any other paramters for execute backup If, example, user in env file not have permission for backup db you setting manually user and password in config file. example:

```
 'listconnections' => [
        [
            'connection' => env('DB_CONNECTION'),
            'db_name' => 'db_name',
            'db_host' => 'db_host',
            'db_username' => 'user',
            'db_password' => 'password123',
            'daily' => false,
            'datetimeFormat' => 'Y-m-d H:i',
            'destinationpath' => 'c:\tmp\\',
            'days_for_delete' => 1,
            'soft_delete' => false
        ]
    ],

```

Delete
------

[](#delete)

You can set, in config file, days\_for\_delete parameter. In this Parameter you set the days for delete previus databases. If you set days\_for\_delete = null delete is disabled. If you set days\_for\_delete = 0 you delete all previus databases.

Another parameters in config file is: soft\_delete if you set this parameter to true you previus databases not would deleted but moved in folder called trash created in destinationpath

exemple:

```
//  config/backup-database.php
[
    'connection' => env('DB_CONNECTION'),
    'db_name' => 'db_name',
    'db_host' => 'db_host',
    'db_username' => 'user',
    'db_password' => 'password123',
    'daily' => false,
    'datetimeFormat' => 'Y-m-d H:i',
    'destinationpath' => 'c:\tmp\\',
    'days_for_delete' => 1,
    'soft_delete' => false
]

```

in this case trash folder would created in c:\\tmp -&gt; c:\\tmp\\trash

For install:
------------

[](#for-install)

```
composer require salvatorecervone/backup-database

```

For publish config
------------------

[](#for-publish-config)

```
php artisan vendor:publish --tag="backup-database-config"

```

For test use
------------

[](#for-test-use)

```
php artisan tink

```

after

```
BackupDatabase::backup();

```

This return result in terminal and create backup in config.destinationpath

View
----

[](#view)

In the blade view

```
http://127.0.0.1:8000/backups

```

you have a list of your backup of your driver connection.

In this view you have information of backup and : one button for delete a single backup one button for lunch all backups

Artisan command
---------------

[](#artisan-command)

You find a command artisan for lunch backup for CLI or insert in schedulate

```
php artisan backup-database:backup

```

Schedule
--------

[](#schedule)

If you schedule this, for example, every day you can use default laravel schedulate

```
App\Console\Kernel.php

 protected function schedule(Schedule $schedule)    {
    $schedule->command('backup-database:backup')->dailyAt('3:00')
}

```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance69

Regular maintenance activity

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 98.8% of commits — single point of failure

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 ~17 days

Recently: every ~66 days

Total

19

Last Release

179d ago

Major Versions

1.91 → 2.0.12025-04-23

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/40053308?v=4)[SalvatoreCervone](/maintainers/SalvatoreCervone)[@SalvatoreCervone](https://github.com/SalvatoreCervone)

---

Top Contributors

[![SalvatoreCervone](https://avatars.githubusercontent.com/u/40053308?v=4)](https://github.com/SalvatoreCervone "SalvatoreCervone (80 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelmssqlsql serverSalvatoreCervonebackup-database

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/salvatorecervone-backup-database/health.svg)

```
[![Health](https://phpackages.com/badges/salvatorecervone-backup-database/health.svg)](https://phpackages.com/packages/salvatorecervone-backup-database)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

13.0k107.5M1.6k](/packages/spatie-laravel-permission)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.2k12.6M140](/packages/dedoc-scramble)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k5.4M50](/packages/spatie-laravel-pdf)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

46273.9k](/packages/harris21-laravel-fuse)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

25060.1k](/packages/vormkracht10-laravel-mails)

PHPackages © 2026

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