laravel-backup: All backups gone, and backup:monitor doesn't work now
4 days ago I updated to v6, and everything worked fine, until today.
All of a sudden, all my backups are gone this morning (I have all my scheduled backups jobs running at night), and backup:monitor
doesn’t work anymore, even after manually running a backup and then backup:monitor
, it tells me that there’s no backups and it’s unhealthy.
backup:list
doesn’t work correct either. It’s showing the wrong disk and no backups as well.
I’m using S3 as disk.
I thought that maybe it was because I forgot to update the backup.php
config file, to match the newest v6 file, so I just did that, and it still doesn’t work.
But again, it worked without the v6 config file for 4 days, and it still doesn’t work with the v6 config.
Any clues to what could cause this?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 20 (7 by maintainers)
@rubenvanassche I think that was the problem. I see multiple zip files in S3 now, so they haven’t been getting deleted every night.
I’d definitely recommend putting a loud, clear, prominent warning at https://github.com/spatie/laravel-backup#changelog saying that changes to the source code will sometimes cause all backups to be deleted if you don’t properly update your configs during any upgrades.
Thanks again for this repo and for all the other repos. You all are amazing. 😃
@rubenvanassche Thanks for looking into it. Yes, my backups continually get deleted from S3 such that only one remains.
I have
"spatie/laravel-backup": "^6.7"
installed.I just did a diff from https://github.com/spatie/laravel-backup/blob/6.7.0/config/backup.php
I’m noticing some differences:
I now see the note about snake_casing here: https://github.com/spatie/laravel-backup/blob/e3ea9bc9994be5cf8d9e10b202ed838380e0b4e4/CHANGELOG.md#600---2018-12-29
And here https://github.com/spatie/laravel-backup/blob/a9ddd3d79b4e853c79040468403364bd61ba9eb4/UPGRADING.md
I guess I missed those warnings at some point. I wouldn’t be surprised if these mistakes are the root cause. I’ll post again here once I’ve tried fixing it all up. Thanks.
Just wanted to leave this here for the next guy to come along. I’m upgrading an old project from 5.12 to 6.11 and had the same issue with the old backups all being deleted.
This isn’t a bug, but rather I missed the changes to the config.backup.php file as well, which seems to be the cause.
My first clue something was wrong was running backup:list and getting back “Local” as the disk (actually storing on S3) as well as “No backups present” displayed. When I actually logged into AWS they were all there.
I then ran backup:run, and the manually triggered backup went off smoothly. On the next scheduled (using Forge) update, all backups but the 2 most recent were wiped out. Fortunately this isn’t a problem on this project, but I agree the a BIG warning might be useful (I did read through the Changelog prior to deploying and still missed btw.)
To fix, I manually deleted backup.php from the config folder and republished the assets using:
php artisan vendor:publish --provider=“Spatie\Backup\BackupServiceProvider”
per the docs.
Using the correct config file has fixed the issue.
Thank you to @ryancwalsh and @rubenvanassche for the back and forth above. Not sure I would have figured this out so quickly. I’ll second the kudos for all the Spatie projects. You guys do great work!