Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cis4life's avatar

Is it possible to back up my MySql database from forge?

I just subcribed to forge and was wondering is it possible to backup my MySql server (in digital ocean.

If not, what would be best and if possilbe easiest way to backup my MySql database as a .sql file

Thanks

0 likes
1 reply
Cronix's avatar
Cronix
Best Answer
Level 67

I don't believe you can do that from Forge directly.

You can ssh into the forge server and use mysqldump.

mysqldump -u forge -p your_db_name > your_backup_file.sql

just change the your_db_name to the name of your database and the same for whatever you want to name the .sql file (your_backup_file.sql).

-u flag is username, I'm assuming it's the "forge" user, if not change that. When you execute the command, it will ask you for the db password for that user. It will save the file in the same dir that you execute the command. If you want it somewhere else, specify the path to save it, /the/path/to/save/your_backup_file.sql

2 likes

Please or to participate in this conversation.