Skip to content
This repository was archived by the owner on Jul 3, 2022. It is now read-only.

About

A wrapper around spatie/laravel-backup backup command to make it super simple to backup multiple sites on a single server.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multisite Backup Command for spatie/laravel-backup

Latest Stable Version Total Downloads License

This command wraps the spatie/laravel-backup backup command to make it super simple to backup multiple sites on a single server - from the one Laravel installation. You can read more about is over on my blog.

Installation

You should already have spatie/laravel-backup installed and configured.

You can install using composer from Packagist.

$ composer require timacdonald/multisite-backup-command

Usage

Extend the class and add the command to your app as per usual. Then add you sites the $sites variable:

<?php

namespace App\Console\Commands;

use TiMacDonald\MultisiteBackupCommand\BackupCommand as BaseBackupCommand;

class BackupCommand extends BaseBackupCommand
{
    protected $sites = [
        [
            'name' => 'My Website',
            'databases' => [
                'mysql' => 'timacdonald_mysql_db',
                'pgsql' => 'timacdonald_pgsql_db',
            ],
            'include' => ['timacdonald.me/storage/app'],
        ],
        [
            'name' => 'A Wordpress Website',
            'databases' => ['mysql' => 'my_wp_db'],
            'include' => ['wordpress.site.com.au/wp-content/uploads'],
        ],
    ];
}

And then you will have to following commands available:

# Backup all sites
php artisan app:backup --run

# Clean all sites
php artisan app:backup --clean

# List all sites
php artisan app:backup --list

# Monitor all sites
php artisan app:backup --monitor

v1 to v2 upgrade guide

The structure of the $sites array has changed. Please update the array and you should be good to go.

Previously:

protected $sites = [
    [
        'domain' => 'timacdonald.me',
        'database' => 'timacdonald_mysql_db',
        'paths' => ['storage/app'],
    ],
];

Update each site to the following structure:

protected $sites = [
    [
        'name' => 'https://timacdonald.me',
        'databases' => ['mysql' => 'timacdonald_mysql_db'],
        'include' => ['timacdonald.me/storage/app'],
    ],
];

And your done!

Thanksware

You are free to use this package, but I ask that you reach out to someone (not me) who has previously, or is currently, maintaining or contributing to an open source library you are using in your project and thank them for their work. Consider your entire tech stack: packages, frameworks, languages, databases, operating systems, frontend, backend, etc.

About

A wrapper around spatie/laravel-backup backup command to make it super simple to backup multiple sites on a single server.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages