Backup Your Forum!

Welcome to Another Admin Forum!

Welcome to Another Admin Forum! Join our community of forum creators today. Register for a free account and get tips, resources, and support to build and grow your forum. Let's create better forums together!

Shawn Gossman

Administrator
AAF Administrator
AAF Moderator
Joined
Jul 5, 2024
Messages
1,011
Reaction score
191
How often do you backup your forum?

How do you backup your forum? Do you do it manually, rely on your hosting service, or both?

How and where do you store backups?

Have you ever had to use a backup?
 
How often: Daily
How: have a script that runs via a CRON job
How/Where: 7 day rolling full backup stored on the server, on 2 separate VPS's (rsync) at opposite sides of the US, on my home desktop and on my home NAS.
Have ever used: Yes, when moving to a new VPS instance I will run my backup routine for that day and then use that archive to move over to the new VPS. As for needing it for recover, only twice when doing a XenForo upgrade.

For those that run a VPS and would like a script to use it via a CRON job (it does depend on the VPS/server having ZIP installed). It also assumes you are using UTF8MB4 character set, which both Invision and XenForo require and Wordpress can use. I am not sure about other scripts. This has been working for me for the last several years.
Bash:
#!/bin/bash
####################################
#
# Backup to local directory 7 day rolling.
#
####################################
mysqldump_location="/path/to/your/website/root/directory"
/usr/bin/mysqldump --opt YOURDBNAME --single-transaction --default-character-set=utf8mb4 > $mysqldump_location/yourSQLdumpfile.SQL
# What to backup.
backup_files="/path/to/your/website/root/directory"
# Where to backup to.
dest="/path/to/store/locally"
# Create archive filename.
day=$(date +%A)
hostname=$(hostname -s)
archive_file="yourdomain.ext-$day.zip"
# Backup the files using ZIP.
zip -r $dest/$archive_file $backup_files
rm -f $mysqldump_location/yourSQLdumpfile.SQL
 
Last edited:
How often: Daily
How: have a script that runs via a CRON job
How/Where: 7 day rolling full backup stored on the server, on 2 separate VPS's (rsync) at opposite sides of the US, on my home desktop and on my home NAS.
Have ever used: Yes, when moving to a new VPS instance I will run my backup routine for that day and then use that archive to move over to the new VPS. As for needing it for recover, only twice when doing a XenForo upgrade.

For those that run a VPS and would like a script to use it via a CRON job (it does depend on the VPS/server having ZIP installed). It also assumes you are using UTF8MB4 character set, which both Invision and XenForo require and Wordpress can use. I am not sure about other scripts. This has been working for me for the last several years.
Bash:
#!/bin/bash
####################################
#
# Backup to local directory 7 day rolling.
#
####################################
mysqldump_location="/path/to/your/website/root/directory"
/usr/bin/mysqldump --opt YOURDBNAME --single-transaction --default-character-set=utf8mb4 > $mysqldump_location/yourSQLdumpfile.SQL
# What to backup.
backup_files="/path/to/your/website/root/directory"
# Where to backup to.
dest="/path/to/store/locally"
# Create archive filename.
day=$(date +%A)
hostname=$(hostname -s)
archive_file="yourdomain.ext-$day.zip"
# Backup the files using ZIP.
zip -r $dest/$archive_file $backup_files
rm -f $mysqldump_location/yourSQLdumpfile.SQL
Nice resource here :)
 
I should note... that script only really works if your data (including your images) are stored locally. If they are stored on an S3/R2 type instance, then you will have to add to it. I don't mess with that yet, as I have plenty of space. But that may change also. Depends on how the KimSufi E3 server (Intel Xeon E3-1245v2 - 4c/8t - 3.4 GHz/3.8 GHz) I just got for $15 (2x480SSD and 32GB RAM) does. Base specs are higher than the VPS I have from Hetzner, but I have to see how the performance is. The network pipe is also only 300/mbps unmetered, for for smaller sites should be fine.
If nothing else, I can use it for additional off-site storage.
 
Back
Top Bottom