sprint-digital/sprint-backup
最新稳定版本:12.0.1
Composer 安装命令:
composer require sprint-digital/sprint-backup
包简介
This is my package sprint-backup
README 文档
README
Back up and secure database to AWS S3. Then redistribute the backup to other team environments.
DO NOT SKIP THIS STEP!!! please read AWS setup HERE.
Installation
You can install the package via composer:
composer require sprint-digital/sprint-backup
Add environment variables to your .env file:
BACKUP_AWS_ACCESS_KEY_ID= BACKUP_AWS_SECRET_ACCESS_KEY= BACKUP_AWS_DEFAULT_REGION=ap-southeast-2 BACKUP_AWS_BUCKET=sprint-db-bucket BACKUP_AWS_USE_PATH_STYLE_ENDPOINT=false BACKUP_ARCHIVE_PASSWORD="{zipSecret}" BACKUP_AWS_PATH="{repoName}" BACKUP_MASTER_PASSWORD="{userPassword}"
Add the following to your config/filesystems.php in disks array:
's3-backup' => [ 'driver' => 's3', 'key' => env('BACKUP_AWS_ACCESS_KEY_ID'), 'secret' => env('BACKUP_AWS_SECRET_ACCESS_KEY'), 'region' => env('BACKUP_AWS_DEFAULT_REGION'), 'bucket' => env('BACKUP_AWS_BUCKET'), 'url' => env('BACKUP_AWS_URL') . '/' . env('BACKUP_AWS_PATH'), 'endpoint' => env('BACKUP_AWS_ENDPOINT'), 'use_path_style_endpoint' => env('BACKUP_AWS_USE_PATH_STYLE_ENDPOINT', false), 'throw' => false, ],
You can publish the config file with:
php artisan backup:install
Backup database:
php artisan backup:to-sprint
Restore database:
php artisan backup:restore
# or auto run the last backup
php artisan backup:restore --last-backup
In some cases the .sql file is too large to be restored. You need to increase the memory limit in your php.ini file.
Production / Staging
You might have to install mysql on your server. (ie. worker servers)
sudo apt-get install -y default-mysql-client
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 920
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-21