PHPackages                             zenstruck/backup-bundle - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zenstruck/backup-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

zenstruck/backup-bundle
=======================

Symfony Bundle that wraps backup commands

v2.2.0(2y ago)1710.2k↓12.5%2[3 issues](https://github.com/kbond/ZenstruckBackupBundle/issues)MITPHPPHP &gt;=8.0

Since Apr 22Pushed 2y ago2 watchersCompare

[ Source](https://github.com/kbond/ZenstruckBackupBundle)[ Packagist](https://packagist.org/packages/zenstruck/backup-bundle)[ Docs](https://zenstruck.com/projects/ZenstruckBackupBundle)[ GitHub Sponsors](https://github.com/kbond)[ RSS](/packages/zenstruck-backup-bundle/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (20)Used By (0)

ZenstruckBackupBundle
=====================

[](#zenstruckbackupbundle)

This bundle allows creating and managing backups in a Symfony application. It is a wrapper for [zenstruck/backup](https://github.com/kbond/php-backup).

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

[](#installation)

1. Install with composer:

```
composer require zenstruck/backup-bundle
```

2. Enable the bundle: This Step is only needed if you are not using [Symfony Flex](https://symfony.com/doc/current/setup/flex.html).

    ```
    // config/bundles.php

    return [
            // ...
            Zenstruck\BackupBundle\ZenstruckBackupBundle::class => ['all' => true],
        ];
    ```

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

[](#configuration)

In your `config/packages/zenstruck_backup.yaml` add at least one source, namer, processor, and destination as well as a profile.

Example:

```
zenstruck_backup:
    sources:
        database:
            mysqldump:
                database: my_database
        files:
            rsync:
                source: "%kernel.project_dir%/public/files"
                additional_options:
                    - --exclude=_cache/
    namers:
        daily:
            timestamp:
                format: d
                prefix: mysite-
        snapshot:
            timestamp:
                prefix: mysite-
    processors:
        zip: { zip: ~ }
    destinations:
        s3:
            s3cmd:
                bucket: "s3://foobar/backups"
    profiles:
        daily:
            scratch_dir: "%kernel.project_dir%/cache/backup"
            sources: [database, files]
            namer: daily
            processor: zip
            destinations: [s3]
```

Commands
--------

[](#commands)

### Run Backup Command

[](#run-backup-command)

```
Usage:
 zenstruck:backup:run [--clear] []

Arguments:
 profile  The backup profile to run (leave blank for listing)

Options:
 --clear  Set this flag to clear scratch directory before backup

```

**NOTES**:

1. Add `-vv` to see the log.
2. For long running backups, it may be required to increase the `memory_limit` in your `bin/console`.
3. Running the command without a profile will list available profiles.

Examples (with the above configuration):

- Create a backup at: `s3://foobar/backups/mysite-{day-of-month}`

    ```
      bin/console zenstruck:backup:run daily

    ```
- Create a backup at: `s3://foobar/backups/mysite-{YYYYMMDDHHMMSS}`

    ```
      bin/console zenstruck:backup:run snapshot

    ```

### List Existing Backups

[](#list-existing-backups)

```
Usage:
  zenstruck:backup:list []

Arguments:
  profile  The backup profile to list backups for (leave blank for listing)

```

**NOTE**: Running the command without a profile will list available profiles.

Full Default Config
-------------------

[](#full-default-config)

```
zenstruck_backup:
    namers:

        # Prototype
        name:
            simple:
                name:                 backup
            timestamp:
                format:               YmdHis
                prefix:               ''
                timezone:             ~
    processors:

        # Prototype
        name:
            zip:
                options:              '-r'
                timeout:              300
            gzip:
                options:              '-czvf'
                timeout:              300
    sources:

        # Prototype
        name:
            mysqldump:
                database:             ~ # Required
                host:                 ~
                user:                 root
                password:             null
                ssh_host:             null
                ssh_user:             null
                ssh_port:             22
                timeout:              300
            rsync:
                source:               ~ # Required
                timeout:              300
                additional_options:   []
                default_options:

                    # Defaults:
                    - -acrv
                    - --force
                    - --delete
                    - --progress
                    - --delete-excluded
    destinations:

        # Prototype
        name:
            stream:
                directory:            ~ # Required
            flysystem:
                filesystem_service:   ~ # Required
            s3cmd:
                bucket:               ~ # Required, Example: s3://foobar/backups
                timeout:              300
    profiles:

        # Prototype
        name:
            scratch_dir:          '%kernel.cache_dir%/backup'
            sources:              [] # Required, can be a string
            namer:                ~  # Required
            processor:            ~  # Required
            destinations:         [] # Required, can be a string
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 95.4% 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 ~224 days

Recently: every ~116 days

Total

17

Last Release

819d ago

Major Versions

v0.5.0 → v1.0.02015-10-31

v1.2.0 → v2.0.02022-11-10

1.x-dev → v2.0.12022-11-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/707369cc916e0ea1aacbf077dcba464f611cef879f024d8944311a54a15224b3?d=identicon)[kbond](/maintainers/kbond)

---

Top Contributors

[![kbond](https://avatars.githubusercontent.com/u/127811?v=4)](https://github.com/kbond "kbond (62 commits)")[![Chris53897](https://avatars.githubusercontent.com/u/7104259?v=4)](https://github.com/Chris53897 "Chris53897 (2 commits)")[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (1 commits)")

---

Tags

symfonybundlebackup

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zenstruck-backup-bundle/health.svg)

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

###  Alternatives

[winzou/state-machine-bundle

Bundle for the very lightweight yet powerful PHP state machine

34010.4M15](/packages/winzou-state-machine-bundle)[pentatrion/vite-bundle

Vite integration for your Symfony app

2755.3M13](/packages/pentatrion-vite-bundle)[ekreative/uuid-extra-bundle

Paramconverter, Normalizer and Form Type for Ramsey Uuid

18168.6k](/packages/ekreative-uuid-extra-bundle)[fsi/datagrid-bundle

FSi Datagrid Bundle

1859.8k1](/packages/fsi-datagrid-bundle)[glooby/task-bundle

Scheduling of tasks for symfony made simple

3216.3k](/packages/glooby-task-bundle)

PHPackages © 2026

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