How to Export MySQL Database in Laravel Forge Growth Plan

Beda Arta
LaravelLaravel ForgeDatabase

Database backup is not available for the Hobby and Growth plan in Laravel Forge. But sometimes you want to get the database from your server. The following are the manual steps that I usually use to get my MySQL database in Growth plan

  1. Log in to the server using SSH
ssh forge@example.com
  1. Log in as a superuser by typing this command
sudo su

Enter server password.

  1. Then go to the directory of the site, example my site located at /home/examplecom
cd /home/examplecom
  1. Run this command to backup the database
mysqldump -u forge -p databasename --single-transaction --quick --lock-tables=false > databasename-backup.sql

Enter database password.

  1. The backup file can be found inside /home/examplecom. The next step is to download the backup file using SCP to your local computer.
scp forge@example.com:/home/examplecom/databasename-backup.sql ./
  1. After downloading the backup file, I usually delete the backup file in the server inside /home/examplecom
rm -rf databasename-backup.sql

I hope Laravel Forge will have a backup feature for Hobby and Growth plan in the future so I don't have to do this.

💡 For bigger projects, consider using managed database services like AWS RDS, Linode Managed Database, DigitalOcean Managed Databases, or PlanetScale. They offer automated backups, better scalability, and improved reliability compared to hosting your database on the same server as your application.