nowo-tech/site-backup-bundle

Symfony bundle for integral website backups with checksum integrity and a safe restore UI (loading page) that does not break the app mid-restore.

Maintainers

Package info

github.com/nowo-tech/SiteBackupBundle

Documentation

Type:symfony-bundle

pkg:composer/nowo-tech/site-backup-bundle

Transparency log

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.1.0 2026-07-29 15:11 UTC

This package is auto-updated.

Last update: 2026-07-29 15:12:29 UTC


README

CI Packagist Version Packagist Downloads License PHP Symfony GitHub stars Coverage

Found this useful? Install from Packagist · Give it a star on GitHub so more developers can find it.

Site Backup Bundle — Create an integral website backup (selected paths + optional DB dump + SHA-256 MANIFEST.json), restore it safely behind a loading page UI, and finish cold bootstrap with a setup wizard (DB, migrations, admin, sample data). Tested on Symfony 7.4, 8.0, and 8.1 · PHP 8.2+ (Symfony 8.x requires PHP 8.4+).

FrankenPHP Friendly Worker Mode

This bundle is FrankenPHP worker mode friendly.

Features

  • Integral backup — Configurable include paths, exclude patterns, optional database_dump_command, .tar.gz + sidecar metadata.
  • Integrity — Per-file SHA-256 in MANIFEST.json plus archive SHA-256; verify before restore.
  • Safe restore — Validate → extract to staging → apply with protected paths → progress JSON; var/site-backup/ never overwritten mid-restore.
  • Loading page — While restore is active, kernel.request returns HTTP 503 with a progress UI (polls /_site_backup/progress.json); panel stays reachable.
  • Setup wizard — Cold start / post-restore: create DB, migrations/schema, minimal SQL, idempotent loaders, super-admin, optional sample data — see docs/SETUP-WIZARD.md.
  • Admin panel — Create / verify / restore / delete under /_site_backup (password gate + CSRF).
  • CLIcreate, list, verify, restore, setup, setup-status, setup-reset, hash-password.

Installation

composer require nowo-tech/site-backup-bundle

With Symfony Flex, the recipe registers the bundle and config. Without Flex, see docs/INSTALLATION.md.

# config/routes.yaml
nowo_site_backup:
    resource: '@NowoSiteBackupBundle/Resources/config/routes.yaml'

Requirements

  • PHP >=8.2 (<8.6); Symfony 8.0 and 8.1 require PHP 8.4+
  • Symfony 7.4, 8.0, or 8.1 (minimum supported minors; also works on Symfony 7.0–7.3 via composer.json constraints)
  • tar available on the host/container for archive create/extract
  • Twig for the restore page, panel, and setup wizard templates

Configuration

nowo_site_backup:
    enabled: true
    backup:
        include_paths: [config, public, templates, src, composer.json, composer.lock]
        database_dump_command: '%env(default::SITE_BACKUP_DUMP_CMD)%'
    panel:
        path_prefix: '/_site_backup'
    security:
        password_protection: true
        password_hash: '%env(SITE_BACKUP_PASSWORD_HASH)%'
    setup:
        admin_provisioner: App\Setup\AdminUserProvisioner

Usage

php bin/console nowo:site-backup:create -l "pre-deploy"
php bin/console nowo:site-backup:verify <id>
php bin/console nowo:site-backup:restore <id> -y

Open /_site_backup to manage backups from the UI. During restore, visitors see the loading page; the panel and progress endpoint keep working. For cold DB / post-restore, open /_setup (see docs/SETUP-WIZARD.md).

See docs/USAGE.md.

Demo

Demo Symfony PHP Default port
demo/symfony8 8.1 8.5 8056

Runs FrankenPHP + Caddy (FRANKENPHP_MODE=worker by default). See docs/DEMO-FRANKENPHP.md.

make -C demo help
make -C demo up-symfony8

Development

make up
make install
make test
make cs-check
make phpstan
make release-check

Documentation

Additional documentation

Tests and coverage

  • Tests: PHPUnit (PHP)
  • PHP: 99.4% Lines (gate ≥ 99% via make coverage-check)
  • Residual OS/defensive branches: see docs/COVERAGE.md

License and author

MIT · Nowo.tech