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(1y ago)10MITPHPPHP ^8.0

Since May 25Pushed 1y 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 today

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 41% of packages

Maintenance46

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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

406d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/79702243?v=4)[Yassine Ait sidi brahim](/maintainers/Asyassin10)[@Asyassin10](https://github.com/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

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k3.5k](/packages/leantime-leantime)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3991.8k](/packages/codewithdennis-larament)

PHPackages © 2026

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