PHPackages                             miguilim/laravel-singlestore-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. [Database &amp; ORM](/categories/database)
4. /
5. miguilim/laravel-singlestore-backup

ActiveLibrary[Database &amp; ORM](/categories/database)

miguilim/laravel-singlestore-backup
===================================

A package that makes it easy to make backups of your SingleStore database.

1.3.2(1mo ago)95.9k1MITPHP

Since Mar 6Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/miguilimzero/laravel-singlestore-backup)[ Packagist](https://packagist.org/packages/miguilim/laravel-singlestore-backup)[ RSS](/packages/miguilim-laravel-singlestore-backup/feed)WikiDiscussions main Synced 1mo ago

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

Laravel SingleStore Backup
==========================

[](#laravel-singlestore-backup)

Laravel SingleStore Backup is a package that makes it easy to make backups of your SingleStore database to your favorite storage. Behind the scenes, this package uses the `BACKUP DATABASE` command, a [native command](https://docs.singlestore.com/db/v8.1/reference/sql-reference/operational-commands/backup-database/) from SingleStore DB engine.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Supported Drivers](#supported-drivers)
- [Configuring](#configuring)
- [Basic Usage](#basic-usage)
    - [Setting Timeout Parameter](#setting-timeout-parameter)
    - [Setting With Date Parameter](#setting-with-date-parameter)
    - [Setting With Time Parameter](#setting-with-time-parameter)
    - [Init Backup](#init-backup-non-local-only)
    - [Differential Backup](#differential-backup-non-local-only)
- [Prune Backups](#prune-backups)
    - [Prune Incremental Backups](#prune-incremental-backups)
    - [Prune Backups Older Than Days](#prune-backups-older-than-days)
    - [Prune Backups Older Than Date](#prune-backups-older-than-date)
- [Advanced Usage](#advanced-usage)
- [Publishing Config File](#publishing-config-file)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require miguilim/laravel-singlestore-backup
```

Supported Drivers
-----------------

[](#supported-drivers)

This package supports the following backup drivers:

- Local - `local`
- S3 / S3 compatible - `s3`
- Google Cloud Storage - `gcs`
- Azure Blobs - `azure`

Configuring
-----------

[](#configuring)

You must add the following lines to your .env file in order to configure your S3 credentials:

```
SINGLESTORE_BACKUP_DRIVER=

# Local / External storage
SINGLESTORE_BACKUP_PATH=

# External storage (S3 / GCS / Azure)
SINGLESTORE_BACKUP_ENDPOINT=
SINGLESTORE_BACKUP_BUCKET=
SINGLESTORE_BACKUP_PUBLIC_KEY=
SINGLESTORE_BACKUP_SECRET_KEY=

# S3 storage (optionals)
SINGLESTORE_BACKUP_REGION=
SINGLESTORE_BACKUP_MULTIPART_CHUNK_SIZE=
SINGLESTORE_BACKUP_FORCE_PATH_STYLE=
SINGLESTORE_BACKUP_COMPATIBILITY_MODE=
```

Basic Usage
-----------

[](#basic-usage)

Below there is a simple example of how you use the backup command. By default, the command will do a full backup.

```
php artisan singlestore:backup
```

### Setting Timeout Parameter

[](#setting-timeout-parameter)

You can set the timeout parameter, a value specified in milliseconds, to determines the length of time to wait for the `BACKUP DATABASE` command to commit across the cluster. If not specified, the `default_distributed_ddl_timeout` global variable value is used.

```
php artisan singlestore:backup --timeout=30000
```

### Setting With Date Parameter

[](#setting-with-date-parameter)

If you want to add the date to the backup name, you can do that by using the `--with-date` parameter.

```
php artisan singlestore:backup --with-date
```

### Setting With Time Parameter

[](#setting-with-time-parameter)

If you want to add the time to the backup name, you can do that by using the `--with-time` parameter.

```
php artisan singlestore:backup --with-time
```

Important

The `--with-date` and `--with-time` parameters cannot be used in an incremental backup.

### Init Backup

[](#init-backup)

If you're making an incremental backup and want to create the `INIT` backup, you can do that by using the `--init` parameter.

```
php artisan singlestore:backup --init
```

### Differential Backup

[](#differential-backup)

If you're making an incremental backup and want to do a `DIFFERENTIAL` backup, you can do that by using the `--differential` parameter.

```
php artisan singlestore:backup --differential
```

Prune Backups
-------------

[](#prune-backups)

You can prune backups by using the `singlestore:prune-backups` command. This command will prune the `{$database}.backup` directory by default.

```
php artisan singlestore:prune-backups
```

Important

All pruning command can only be executed with the `s3` driver, and they follow the path specified in the `SINGLESTORE_BACKUP_PATH` environment variable.

### Prune Incremental Backups

[](#prune-incremental-backups)

If you want to prune incremental backups, you can do that by using the `--incremental` parameter. This will prune the `{$database}.incr_backup` directory.

```
php artisan singlestore:prune-backups --incremental
```

### Prune Backups Older Than Days

[](#prune-backups-older-than-days)

If you want to prune backups older than a certain number of days, you can do that by using the `--older-than-days` parameter. This will prune the `{$database}_(.*?).backup` (respecting the date) directory.

```
php artisan singlestore:prune-backups --older-than-days=30
```

### Prune Backups Older Than Date

[](#prune-backups-older-than-date)

If you want to prune backups older than a certain date, you can do that by using the `--older-than-date` parameter. This will prune the `{$database}_(.*?).backup` (respecting the date) directory.

```
php artisan singlestore:prune-backups --older-than-date=2024-01-01
```

Important

Be careful when using the `--older-than-date` or `--older-than-days` parameters. They will prune all directories matched with the `{$database}_(.*?).backup` pattern + respecting the date specified. It may delete other unrelated directories if they match the pattern.

Advanced Usage
--------------

[](#advanced-usage)

Sometimes the simple backup command with configs may not be flexible as you want. Instead, you can use the `SinglestoreBackup` class:

```
use Miguilim\LaravelSinglestoreBackup\SinglestoreBackup;

$backupInstance = new SinglestoreBackup(
    driver: 'local',
    database: 'mydatabase',
    path: '/my-backup/path'
);

$result = $backupInstance->executeQuery();
```

Available arguments:

- `driver`
- `database`
- `path`
- `endpoint`
- `timeout`
- `publicKey`
- `secretKey`
- `bucket`
- `init`
- `differential`
- `region`
- `multipartChunkSizeMb`
- `s3ForcePathStyle`
- `compatibilityMode`
- `withDate`
- `withTime`

Publishing Config File
----------------------

[](#publishing-config-file)

You can publish the package configuration file to your project with the following command:

```
php artisan vendor:publish --tag=singlestore-backup-config
```

License
-------

[](#license)

Laravel SingleStore Backup is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance90

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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

Recently: every ~185 days

Total

13

Last Release

45d ago

Major Versions

0.2.0 → 1.0.02023-08-08

### Community

Maintainers

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

---

Top Contributors

[![miguilimzero](https://avatars.githubusercontent.com/u/35383529?v=4)](https://github.com/miguilimzero "miguilimzero (31 commits)")

### Embed Badge

![Health badge](/badges/miguilim-laravel-singlestore-backup/health.svg)

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

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[cviebrock/eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel

4.0k13.6M253](/packages/cviebrock-eloquent-sluggable)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[ryangjchandler/orbit

A flat-file database driver for Eloquent.

922256.2k5](/packages/ryangjchandler-orbit)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)

PHPackages © 2026

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