PHPackages                             cyberwizard/dbsafeguard - 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. cyberwizard/dbsafeguard

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

cyberwizard/dbsafeguard
=======================

A Laravel package for safeguarding your database with easy-to-use backup commands.

1.3.0(1mo ago)45.2k↑45.5%1MITPHPPHP ^8.0

Since May 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/cyberwizard-dev/DBSafeGuard)[ Packagist](https://packagist.org/packages/cyberwizard/dbsafeguard)[ RSS](/packages/cyberwizard-dbsafeguard/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

DBSafeGuard
===========

[](#dbsafeguard)

DBSafeGuard is a Laravel package that provides a convenient command-line interface to back up your database. It supports MySQL and PostgreSQL databases, and allows you to save backups locally or upload them directly to AWS S3.

What's New in 1.3.0
-------------------

[](#whats-new-in-130)

- **Progress Bars:** Added visual progress bars for both local database dumping and S3 uploading.
- **Backup Retention:** Automatically clean up old backups to save storage. Keep the latest backups based on the new `MAX_BACKUPS` environment variable (defaults to 3).

What's New in 1.2.1
-------------------

[](#whats-new-in-121)

- **Memory Optimization:** Fixed a memory exhaustion issue when uploading large database backups to S3 by using file streams.

What's New in 1.1.0
-------------------

[](#whats-new-in-110)

- **Laravel 12 Support:** Fully compatible with Laravel 9.0 through 12.0+.
- **PostgreSQL Support:** Automatically detects your connection and supports `pg_dump`.
- **S3 Uploads:** Stream backups directly to AWS S3 using the new `--disk=s3` flag.

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- Laravel 9.0, 10.0, 11.0, or 12.0+
- `mysqldump` or `pg_dump` installed on your server (depending on your database)

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

[](#installation)

Install the package via Composer:

```
composer require cyberwizard/dbsafeguard
```

If you are installing directly from the GitHub repository, add the following to your `composer.json` first:

```
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/cyberwizard-dev/DBSafeGuard"
    }
]
```

Then run `composer require cyberwizard/dbsafeguard:dev-main`.

Configuration
-------------

[](#configuration)

The package automatically uses your standard Laravel database configuration. Ensure the standard environment variables are set in your `.env` file:

```
DB_CONNECTION=mysql # or pgsql
DB_HOST=127.0.0.1
DB_PORT=3306 # or 5432
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password
```

### S3 Configuration

[](#s3-configuration)

If you plan to upload your backups to AWS S3, you must configure your S3 credentials in your `.env` file:

```
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_DEFAULT_REGION=your_region
AWS_BUCKET=your_bucket_name
```

### Backup Retention

[](#backup-retention)

By default, the package will keep the latest **3** backups and automatically delete older ones to save storage space. You can change this limit by setting the `MAX_BACKUPS` environment variable in your `.env` file:

```
MAX_BACKUPS=5
```

Usage
-----

[](#usage)

### Local Backup

[](#local-backup)

To back up your database to the local disk, run:

```
php artisan backup:db
```

The command will prompt you for a backup path. If you accept the default, the backup file will be stored in the `storage/app/backups` directory with a timestamped filename.

### S3 Backup

[](#s3-backup)

To back up your database and upload it directly to S3, use the `--disk` option:

```
php artisan backup:db --disk=s3
```

This will create a temporary local dump, upload it to the `backups/` directory in your S3 bucket, and then remove the local temporary file.

### Scheduled Backups

[](#scheduled-backups)

You can schedule automatic backups using Laravel's task scheduler. Add the following to your console routes or `App\Console\Kernel` class:

```
// Local backup daily at midnight
Schedule::command('backup:db')->daily();

// S3 backup twice daily
Schedule::command('backup:db --disk=s3')->twiceDaily(1, 13);
```

Author
------

[](#author)

Cyberwizard
Contact:

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance90

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

49d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/408541?v=4)[Eric Rogers](/maintainers/cyberwizard)[@Cyberwizard](https://github.com/Cyberwizard)

---

Top Contributors

[![cyberwizard-dev](https://avatars.githubusercontent.com/u/53139650?v=4)](https://github.com/cyberwizard-dev "cyberwizard-dev (31 commits)")

### Embed Badge

![Health badge](/badges/cyberwizard-dbsafeguard/health.svg)

```
[![Health](https://phpackages.com/badges/cyberwizard-dbsafeguard/health.svg)](https://phpackages.com/packages/cyberwizard-dbsafeguard)
```

###  Alternatives

[craftcms/aws-s3

Amazon S3 integration for Craft CMS

631.5M29](/packages/craftcms-aws-s3)[servd/craft-asset-storage

Servd Asset Storage and Helpers integration for Craft CMS

1184.0k10](/packages/servd-craft-asset-storage)

PHPackages © 2026

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