Database Backup Command

Prerequisites

If gzip is installed on the server, the backup will be compressed to take up less disk space.

Usage

SupportPal includes a command to generate a backup of the database with all the recommended settings applied.

Usage on Docker


$ docker exec -it supportpal bash -c "php artisan db:backup"
Backing up application database...
Backup completed. Duration: 1s


 [OK] The backup has successfully generated at /supportpal/storage/app/database-2021-04-16.sql.gz

Usage on Linux


$ php artisan db:backup
Backing up application database...
Backup completed. Duration: 1s


 [OK] The backup has successfully generated at /supportpal/storage/app/database-2021-04-16.sql.gz

Usage Options

Option Description
--binary-path The command will try to automatically find the path for mysqldump. If it returns an error, you can manually specify the absolute path to mysqldump. For example:
php artisan db:backup --binary-path=C:\laragon\bin\mysql\mysql-5.7.24-winx64\bin
--force Run the command non-interactively.