Laravel-Backpack/BackupManager

Skipping backpack_flags in Browser

dani2191 opened this issue ยท 6 comments

Bug report

When I click the button the backup process is performed but it skips the '--only-db' flag I've set up in backup.php.

What I did:

I set the backpack_flags like this
'backpack_flags' => [ '--disable-notifications'=> true, '--only-db'=> true ],

What I expected to happen:

The backup should only include the DB SQL Dump.

What happened:

The backup includes both application and DB SQL Dump.

What I've already tried to fix it:

I've tried the following:
'backpack_flags' => [ '--disable-notifications'=> true, '--only-db']
'backpack_flags' => [ '--only-db', '--disable-notifications'=> true]
'backpack_flags' => [ '--only-db'=> true, '--disable-notifications'=> true]
'backpack_flags' => [ '--only-db'=> true]
'backpack_flags' => [ '--only-db']

It works as expected when I run it through artisan with:
php artisan backup:run --only-db

Backpack, Laravel, PHP, DB version:

Backpack: 3.6
Laravel: 5.8
PHP: 7.1.3
DB Version: MySQL 5.7.24

Hello there! Thanks for opening your first issue on this repo!
Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.
Backpack communication mediums:

  • Bug Reports, Feature Requests - Github Issues (here);
  • Quick help (How do I do X) - Gitter Chatroom;
  • Long questions (I have done X and Y and it won't do Z wtf) - Stackoverflow, using the backpack-for-laravel tag;

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.
Thank you!
-- Justin Case The Backpack Robot

pxpm commented

You might have your config cached, so changes you made after are not taken into account.

Please try php artisan config:cache to clear the cache and rebuild it from the current values.

BR,

You might have your config cached, so changes you made after are not taken into account.

Please try php artisan config:cache to clear the cache and rebuild it from the current values.

BR,

Tried that, and it's the same.
However, after checking the create() function in BackupController.php, when the artisan run function is called it looks like this:

public function create()
{
try {
ini_set('max_execution_time', 600);

        Log::info('Backpack\BackupManager -- Called backup:run from admin interface');

        Artisan::call('backup:run');

        Log::info("Backpack\BackupManager -- backup process has started");
    } catch (Exception $e) {
        Response::make($e->getMessage(), 500);
    }

    return 'success';
}
So I changed Artisan::call('backup:run'); to Artisan::call('backup:run --only-db'); And now it works like I want to.

Same issue here.

Solved it as you did also with the command Artisan::call('backup:run --only-db');

btw off topic but also can have connection with some of the issues, backup.php config is not aligned to the original file so I created a PR for it.
Link to PR: #67
My second issue besides the original(as yours) was that I had issue that my backups where cleaned up before they should have been.

I updated the backup.conf with original content from spatie-backup and backups work as expected.

@dani2191 check if my PR #67 solves your issue.

@dani2191 check if my PR #67 solves your issue.

Updated BackupManager and now it works as it should. Thanks!