klytron/laravel-backup-complete-restore
Composer 安装命令:
composer require klytron/laravel-backup-complete-restore
包简介
Complete backup restoration for Spatie Laravel Backup - restores both database and files to their exact locations with consolidated configuration and internal health checks (supports Laravel 10-13)
关键字:
README 文档
README
A comprehensive Laravel package for complete backup restoration, including both database and file restoration from Spatie Laravel Backup archives with consolidated configuration and internal health checks.
✨ Features
- 🔄 Complete Restoration: Restore both database and files from Spatie Laravel Backup archives
- 🎯 Consolidated Configuration: Single configuration file that leverages existing Laravel config
- 🛡️ Internal Health Checks: Self-contained health check classes extending dependency packages
- 🔧 Config System Integration: Automatic compatibility with
wnx/laravel-backup-restore - 📁 Smart File Mappings: Intelligent mapping of container paths to local filesystem
- 🚀 Multiple Storage Support: Works with local, S3, Google Drive, and other storage disks
- 🔒 Safety Features: Backup existing files, confirmation prompts, and error handling
- 📊 Progress Tracking: Real-time progress indicators and detailed logging
- 🎨 Beautiful CLI: Colorful, emoji-rich command-line interface
🚀 Quick Start
Installation
composer require klytron/laravel-backup-complete-restore
Basic Usage
# List available backups php artisan backup:restore-complete --list # Restore complete backup (interactive) php artisan backup:restore-complete # Restore specific backup php artisan backup:restore-complete --backup="2024-01-15-10-30-00.zip" # Restore database only php artisan backup:restore-complete --database-only # Restore files only php artisan backup:restore-complete --files-only
📋 Prerequisites
This package requires Spatie Laravel Backup to be installed and configured in your application.
Required Dependencies
- PHP: 8.1 or higher
- Laravel: 10.0, 11.0, 12.0, or 13.0
- Spatie Laravel Backup: 8.0 or higher
- WNX Laravel Backup Restore: 1.6 or higher
📚 Documentation
Getting Started
- 📖 Installation Guide - Complete setup and configuration
- ⚙️ Configuration Guide - Package configuration options
- 🔧 Commands Guide - Available Artisan commands and options
Advanced Usage
- 🛡️ Health Checks - Built-in and custom health checks
- 📁 File Mappings - Understanding and configuring file mappings
- 🔍 Troubleshooting - Common issues and solutions
🎯 Key Benefits
Consolidated Configuration
Instead of multiple configuration files, this package uses a single config/backup-complete-restore.php file that leverages your existing Laravel configuration (config/database.php, config/filesystems.php, config/backup.php).
Internal Health Checks
Self-contained health check classes that extend dependency packages, making the package more maintainable and reducing direct external dependencies.
Seamless Integration
Automatic compatibility with wnx/laravel-backup-restore through config system integration - no physical files needed.
🔧 Configuration
The package automatically registers its configuration. To customize settings:
php artisan vendor:publish --provider="Klytron\LaravelBackupCompleteRestore\BackupCompleteRestoreServiceProvider"
Basic Configuration
// config/backup-complete-restore.php return [ 'file_mappings' => [ 'var/www/html/storage/app/public' => storage_path('app/public'), 'var/www/html/public' => public_path(), 'var/www/html/app' => base_path('app'), ], 'health_checks' => [ \Klytron\LaravelBackupCompleteRestore\HealthChecks\Checks\DatabaseHasTables::class, \Klytron\LaravelBackupCompleteRestore\HealthChecks\Checks\FilesExist::class => [ 'files' => [ storage_path('app/public'), storage_path('logs'), ], ], ], ];
🛠️ Available Commands
| Command | Description |
|---|---|
backup:restore-complete |
Complete backup restoration (database + files) |
backup:health-check |
Run health checks on restored backup |
klytron:backup-health-check |
Run custom health checks |
Command Options
# List backups php artisan backup:restore-complete --list # Selective restoration php artisan backup:restore-complete --database-only php artisan backup:restore-complete --files-only # Backup selection php artisan backup:restore-complete --backup="filename.zip" php artisan backup:restore-complete --disk="s3" # Database options php artisan backup:restore-complete --connection="mysql" php artisan backup:restore-complete --reset # Safety options php artisan backup:restore-complete --force php artisan backup:restore-complete --verbose
🔄 Integration with Spatie Laravel Backup
This package is designed to work seamlessly with Spatie Laravel Backup:
- Spatie creates backups → This package restores them
- Same configuration → Uses your existing Spatie backup configuration
- Same storage disks → Works with all configured storage disks
- Same file structure → Understands Spatie's backup archive format
🎨 Example Output
📋 Available Backups
Disk: local
├── 2024-01-15-10-30-00.zip (15.2 MB)
├── 2024-01-15-09-15-00.zip (14.8 MB)
└── 2024-01-14-23-45-00.zip (14.9 MB)
🔄 Starting complete restoration...
📦 Extracting backup archive...
[████████████████████] 100%
🗄️ Restoring database...
[████████████████████] 100%
📁 Restoring files...
[████████████████████] 100%
✅ Restoration completed successfully!
🔍 Running health checks...
✅ Database has tables
✅ Critical files exist
✅ File integrity verified
🎉 Complete restoration finished successfully!
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
📄 License
The MIT License (MIT). Please see License File for more information.
🙏 Acknowledgments
- Spatie for the excellent Laravel Backup package
- WNX for the Laravel Backup Restore package
- The Laravel community for inspiration and support
📞 Support
- 📧 Email: hi@klytron.com
- 🌐 Website: https://www.klytron.com
- ☕ Support the project: https://www.klytron.com/buy-me-a-coffee
- 🐛 Issues: GitHub Issues
Made with ❤️ by Michael K. Laweh
klytron/laravel-backup-complete-restore 适用场景与选型建议
klytron/laravel-backup-complete-restore 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 08 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「files」 「backup」 「laravel」 「restore」 「spatie」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 klytron/laravel-backup-complete-restore 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 klytron/laravel-backup-complete-restore 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 klytron/laravel-backup-complete-restore 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
An HTML5 upload field for the CMS and frontend forms.
Dibi is Database Abstraction Library for PHP
A SDK for working with B2 cloud storage.
Store your language lines in the database, yaml or other sources
A very simple yet useful helper class to handle PHP file uploads.
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-17