laracoft's avatar

Backup and restore Laravel projects

Can anyone share how they are doing backups and restore of multiple Laravel projects?

In particular, I'm concerned with DB, .env and storage as these are not version controlled.

Preferably it is all done via SSH.

I'm hoping it is easy to setup, verify that it is working correctly and of course, easy to restore too.

0 likes
5 replies
jlrdw's avatar

For DB, I just dump:

mysqldump -uzzzzzzz -pzzzzzzzz --add-drop-database --databases --routines tjtransactions > "D:\zipfold\mysql_backs\xbacks\tjtransactions.sql"

But I believe Spatie has a routine for this, check theit site, or I know github has packages for this also.

Snapey's avatar

I use spatie backup with the target as S3, on about 20 sites.

However, I probably restored less than a handful in 10 years.

martinbean's avatar

@laracoft My code is a repository that’s on both my computer and GitHub; user-uploaded assets are stored in S3; and my applications are deployed to Heroku, which automatically creates a database back-up daily.

dualznz's avatar

I host all my own sites since I run a home datacenter so I have backups on the application storage, db & file storage on raspberry pi 5s with 2tb nand ssds, also off site backups to my dedicated server on ovh

Jsanwo64's avatar

Well. I have my codebase as repository on Github. DB is supabase and storage is S3. And the server where i have Laravel forge installed has a daily backup.

N.B: The repository is private.

Please or to participate in this conversation.