Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Site Backup Bundle

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: bootstrap mode (guided vs full SQL), DB, migrations/schema, YAML tabs + checkers, advance_mode, idempotent loaders, super-admin, optional sample data; durable progress (filesystem / doctrine / chain) — 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.1% Lines (gate ≥ 99% via make coverage-check)
  • Residual OS/defensive branches: see docs/COVERAGE.md

License and author

MIT · Nowo.tech

About

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

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages