MyBB Community Forums

Full Version: what is the easiest way to create a database backups automatically?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i'm a beginner.
Heart
MyBB has a backup task by default. Go to ACP > Tools & Maintenance > Task Manager > Weekly Backup > Options > Enable Task.
thanks
i didn't knew that
can i set it to back it up to dropbox too? or is it a bit more complicated for a beginner?
Not by default no, and haven't heard of a plugin for that.
if you have SSH access. sql back up using SSH is the most secure way to back up.
You can check if your host has any backup facility, some of which you can set schedules to be ran automatically.
I have created a folder called database in my server space one level below public_html.
A read-only, executable script HLFdump.sh is in there, which contains
# shell script to create a mysql dump from HLF database

# create backup
mysqldump --no-tablespaces -h localhost -u db_username -pdbpassword hlf_dbname > ~/database/hlf-db-$(date +%Y-%m-%d).sql

I have a cron job set up in cpanel to execute that script daily. I periodically download that backup to local filespace.
Obviously, delete old files to save space.

I use that backup to upload to a different server for migration or testing purposes.
SSH_command_line$> mysql -h localhost -u db_username -p hlf-db-01-24-22.sql > hlf_dbname

lkop's answer is better. SSH commandline backup is most secure but requires manual initiation.
Cron job script uses stored password, which is less secure, but acceptable for my purposes because of restricted permissions on folder and script, and it is not in the public webspace.

A single backup file is easily transportable, especially for a large database. Limitations of phpMyAdmin narrow the options for restoring.
THANK YOU VERY MUCH ALL