mrtnsn / backup-manager
Backup manager for Laravel
Installs: 104
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 4
Type:package
Requires
- php: ^7.0
- illuminate/console: ~5.1.0||~5.2.0||~5.3.0||~5.4.0||~5.5.0
- illuminate/contracts: ~5.1.0||~5.2.0||~5.3.0||~5.4.0||~5.5.0
- illuminate/database: ~5.1.0||~5.2.0||~5.3.0||~5.4.0||~5.5.0
- illuminate/filesystem: ~5.1.0||~5.2.0||~5.3.0||~5.4.0||~5.5.0
- illuminate/support: ~5.1.0||~5.2.0||~5.3.0||~5.4.0||~5.5.0
- league/flysystem: ^1.0.27
- symfony/process: ~2.7||~3.0
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^6.2
Suggests
- league/flysystem-aws-s3-v3: Allows you to export and import backups on AWS S3
This package is not auto-updated.
Last update: 2024-11-17 08:18:04 UTC
README
Easy to use backup manager for Laravel.
Features
- Quick installation
- Integration with Laravels queue and filesystem
- Support for multiple Laravel versions (
5.1 => 5.5
) - Each table is stored in it's own file
- Chunking of large tables
🔥 Breaking changes
In version 2.0.0
we changed how the backup files are created meaning that backups created
before 2.0.0
can't be automatically imported. They can still be manually imported.
Installation
Composer
composer require mrtnsn/backup-manager
Provider
Add the service provider to providers
in config/app.php
so that it's registered
in your Laravel application.
Mrtnsn\BackupManager\BackupManagerProvider::class,
Publish
If you need to change the default config you have to publish the config file.
php artisan vendor:publish --provider="Mrtnsn\BackupManager\BackupManagerProvider"
Usage
Commands
The package exposes two artisan commands, one for export
and one for import
.
Export
Export will use your current credentials and config to export the database to your desired location. This is done by creating a schema file from the database, then each table is inspected and split into chunks. Each chunk and the schema is uploaded to the desired location.
This command gives no feedback since it's meant to be run from the scheduler. This prevent filling up log files with unnecessary data.
The command can be execute manually with a custom tag, this can be useful if multiple developers are testing different databases on a staging server and need to quickly change between them.
Running it from schedule (app/Console/Kernel.php)
$schedule->command('backup-manager:export') ->daily();
Running it manually
php artisan backup-manager:export
Running it manually with custom tag
php artisan backup-manager:export --tag=newFeature
Import
Import will use your current credentials and config to import a selected backup.
This command is built to be run manually as it needs feedback to get the right backup.
You get to choose which subFolder
and which version
you want to restore.
After this is selected it will loop through all files matching those parameteres
and drop the table before importing it again.
This will cause minimal downtime as it only affects one table at a time.
Running it manually
php artisan backup-manager:import
Default config
Roadmap
- Tests
backup-manager:inspect
to see files and info about a backup- Notification system for failed backups
- Support for PostgreSQL