PHPackages                             yassine-as/laravel-s3-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. yassine-as/laravel-s3-db-backup

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

yassine-as/laravel-s3-db-backup
===============================

Laravel package for database backups to S3 with

v1.0.0(11mo ago)00MITPHPPHP ^8.0

Since May 25Pushed 11mo agoCompare

[ Source](https://github.com/Asyassin10/laravel-s3-db-backup)[ Packagist](https://packagist.org/packages/yassine-as/laravel-s3-db-backup)[ RSS](/packages/yassine-as-laravel-s3-db-backup/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Laravel S3 Database Backup
==========================

[](#laravel-s3-database-backup)

Package for database backups with upload to AWS S3

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

[](#installation)

1. **Install the package via Composer:**

```
composer require yassine-as/laravel-s3-db-backup
```

2. **Publish the configuration file:**

```
php artisan s3-db-backup:install
```

3. **Configure your backup settings:**
    - Open `config/s3-db-backup.php`
    - Set your local backup path, S3 disk, S3 prefix folder, and gzip option.
    - Make sure your AWS S3 credentials and disk are configured in `config/s3-db-backup.php` and `.env`

Environment Variables (.env)
----------------------------

[](#environment-variables-env)

Make sure to add the following variables to your `.env` file for AWS S3 and dump commands paths if needed:

```
# AWS S3 Configuration (required)
AWS_ACCESS_KEY_ID=your_aws_access_key_id
AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key
AWS_DEFAULT_REGION=your_aws_region
AWS_BUCKET=your_s3_bucket_name

# Optional: Custom path to mysqldump command if not in PATH
DB_DUMP_COMMAND_PATH=/usr/bin/mysqldump

# Optional: Custom path to pg_dump command if using PostgreSQL
PG_DUMP_PATH=/usr/bin/pg_dump
```

Usage
-----

[](#usage)

Run the backup command:

```
php artisan db:backup-to-s3
```

### Options

[](#options)

- `--connection=` Specify the database connection (defaults to your default connection)
- `--local-only` Skip uploading the backup to S3 (backup saved locally only)
- `--clean` Delete local backup file after successful upload to S3

### Example

[](#example)

Backup default database, upload to S3, and delete local file:

```
php artisan db:backup-to-s3 --clean
```

Backup MySQL connection only locally (no S3 upload):

```
php artisan db:backup-to-s3 --connection=mysql --local-only
```

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

[](#requirements)

- PHP 8.0+
- Laravel 9 or 10
- AWS S3 configured in Laravel filesystems and `.env`
- `mysqldump` or `pg_dump` installed and accessible in your server PATH or specified in `.env`

Notes
-----

[](#notes)

- Backups are compressed with gzip by default.
- The package supports MySQL and PostgreSQL.
- Be sure your database user has permission to run dump commands.
- Keep your AWS credentials secure.

Author
------

[](#author)

Yassine ait sidi brahim —

Credits
-------

[](#credits)

- [Yassine ait sidi brahim](https://github.com/Asyassin10)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance50

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

Unknown

Total

1

Last Release

353d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78f92d5a0b9a772b86a40be15cfa09c8b0532b084b567e452a408f01ac4e7e50?d=identicon)[Asyassin10](/maintainers/Asyassin10)

---

Top Contributors

[![Asyassin10](https://avatars.githubusercontent.com/u/79702243?v=4)](https://github.com/Asyassin10 "Asyassin10 (2 commits)")[![YassineBti](https://avatars.githubusercontent.com/u/153202148?v=4)](https://github.com/YassineBti "YassineBti (1 commits)")

### Embed Badge

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

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

###  Alternatives

[overtrue/laravel-filesystem-qiniu

A Qiniu storage filesystem for Laravel.

482229.7k16](/packages/overtrue-laravel-filesystem-qiniu)[rahulhaque/laravel-filepond

Use FilePond the Laravel way

261114.4k2](/packages/rahulhaque-laravel-filepond)

PHPackages © 2026

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