Automated Offsite Backups

NightTalon65

New member
Licensed customer
Does anyone know a good way or service to back up critical parts of my forums, like the database, attachments, and related files?
 
Does anyone know a good way or service to back up critical parts of my forums, like the database, attachments, and related files?
Did you search for the word "Backup" in the add on section or the rest of the forum? You's easily have stumbled about this add on


that does all what you are asking for. Obviously, what makes sense totally depends from your options, your hosting situation, the size of your forum and your abilities.
 
Did you search for the word "Backup" in the add on section or the rest of the forum? You's easily have stumbled about this add on


that does all what you are asking for. Obviously, what makes sense totally depends from your options, your hosting situation, the size of your forum and your abilities.
I looked around and I apparently missed this completely, it appears to work for what I need for onsite backup so thats something at least. thanks
 
Making backups it's not enough in itself imo. You must also check the backup to make sure that it has been done correctly and it's not corrupted.
 
im curious why you said that as im already on a vps with namecheap
There are some people on this forums that are worth ignoring. Not many, but some. ;)
how would I go about doing that? I am very new to this and am still learning as I go.
Nuff said: Nobody wants backups everybody wants restore. So you should definitively try to restore your backups on a test system on a regular basis. It would turn out very bad if you made up backups regularly but never restored them and once you need to due to a dataloss you suddenly realize that your backup did not work as intended...

A very old website (dating back to 1997 and thus not even having SSL) that gives a very good and entertaining intro to the backup topic is this:


Back then it was intended to be advertising a commercial backup software in a humorous way, today it is a dinosaur still sitting on the web untouched for 30 years and still worth visiting.

While the backup add on by 8wayrun is a simple and well integrated solution: As you are on a VPS and thus do not suffer from limtations typical for shared hosting you may alternatively use any backup software for unix (there are loads) or simply create a couple of shell scripts using tar, gnuzip and sqldump and place them in your crontab. The backup add on does, if I remember correctly, by default backups only on thursday nights and it does always a full backup of the files. Depending from your forum and our needs you may want more frequent backups and/or rather incremental backups of the filesystem instead of full backups. It is not very difficult and there are plenty of examples on the web.
 
There are some people on this forums that are worth ignoring. Not many, but some. ;)

Nuff said: Nobody wants backups everybody wants restore. So you should definitively try to restore your backups on a test system on a regular basis. It would turn out very bad if you made up backups regularly but never restored them and once you need to due to a dataloss you suddenly realize that your backup did not work as intended...

A very old website (dating back to 1997 and thus not even having SSL) that gives a very good and entertaining intro to the backup topic is this:


Back then it was intended to be advertising a commercial backup software in a humorous way, today it is a dinosaur still sitting on the web untouched for 30 years and still worth visiting.

While the backup add on by 8wayrun is a simple and well integrated solution: As you are on a VPS and thus do not suffer from limtations typical for shared hosting you may alternatively use any backup software for unix (there are loads) or simply create a couple of shell scripts using tar, gnuzip and sqldump and place them in your crontab. The backup add on does, if I remember correctly, by default backups only on thursday nights and it does always a full backup of the files. Depending from your forum and our needs you may want more frequent backups and/or rather incremental backups of the filesystem instead of full backups. It is not very difficult and there are plenty of examples on the web.
What I am looking for is automation of the backup process, to be honest. I have already learned how to do it with command lines and firezilla but the latter is very time consuming, often taking several hours to finish. I would prefer something like a weekly full backup with minor daily backups, so if you have any suggestions on ways to point me that would be most welcome. As for testing it in a test server im unsure how to go about setting that up at all.
 
how would I go about doing that? I am very new to this and am still learning as I go.
The best way imo to check the backup to make sure that it has been done correctly is to set up a test forum using a separate database and restore there the latest backups. Doing that it will cost you a little time, but it's worth the while.
 
What I am looking for is automation of the backup process, to be honest.
As said before: Automation is done via an entry in the crontab, so that's not an issue. For backupping there are many different ways from backup software to simple shell scrips that all work equally good. You just have to make a decision which way to go.
I have already learned how to do it with command lines and firezilla but the latter is very time consuming, often taking several hours to finish.
If you have a lot of data it takes a lot of time to create a full backup and possibly even longer to store it remotely.
I would prefer something like a weekly full backup with minor daily backups, so if you have any suggestions on ways to point me that would be most welcome.
Google for "incremental backup webpage database linux" or something alike - I am sure there are loads of guides that are easy to find. With XF it is as easy as to save the whole directorty it is installed in along with a dump of the database - no rocket science involved. A perfectionist would close the forum during the backup to avoid any data inconsistencies - this is again where the named add on makes life easier than other solutions.
As for testing it in a test server im unsure how to go about setting that up at all.
The same as your VPS: You need a LAMP environment and use your backup to install a clone of your forum there. If you don't know how make use of a backup - what's the point in creating one then?
 
What I am looking for is automation of the backup process, to be honest. I have already learned how to do it with command lines and firezilla but the latter is very time consuming, often taking several hours to finish.
Mine is completely automated via command line and crontab. The key to mine is using rclone. I run a few different servers, and I use rsync to send the backups to other servers, and use rclone to send a backup to one of my 1TB OneDrive accounts, where it then syncs to my server at home. (And I could actually change that around if I wanted to, as I could tunnel into my NAS to receive the backup with rsync, and store in a directory that syncs to OneDrive automatically.)

One could also use an R2 bucket at Cloudflare as a backup location; it would cost money to store larger sites (as it exceeds their free allowance) but I'm pretty sure I tested it with rclone and was able to automate it there as well.

Main thing is, I have daily backups in three different locations, including one under my own roof.
 
Put this question into chatgpt with your OS and exact specifics, and it will create a backup script for you, how to add your crontab, etc etc. It makes this sort of thing very easy for anyone who can use CL.

Example, I asked it: if I wanted to create an automated backup for my xenforo site on almalinux9, can you create a script that won't cripple the site during the backup process, backs up the site files and database, then sends them remote to S3 after backup is complete, deleting the stored server backup. You need to ask me questions for file locations and such. Step by step, dummies guide.

It then responded with:

Step 1 — I Need These Details​


Please answer these:


1️⃣ XenForo file location​


Example paths:



/var/www/xenforo
/home/site/public_html
/var/www/html/community


What is your XenForo root directory?




2️⃣ MySQL / MariaDB database info​


You can find this in:




src/config.php



I need:


  • Database name
  • Database user
  • Database password
  • Database host (usually localhost)

Example:




DB_NAME=xf
DB_USER=xfuser
DB_PASS=password
DB_HOST=localhost





3️⃣ Do you already have AWS CLI installed?​


Run:




aws --version



If not, we'll install it.




4️⃣ Your S3 bucket name​


Example:




my-xenforo-backups



Also tell me:


  • region (example: ap-southeast-2)



5️⃣ Where should temporary backups be stored?​


Example:




/backup
/var/backups
/home/backups



I recommend:




/var/backups/xenforo





6️⃣ Server RAM (optional but useful)​


Run:




free -h





7️⃣ Do you want​


Options:


Simple




1 backup per day



Better




7 daily backups
4 weekly backups





Step 2 — What the Script Will Do (Simple Overview)​


The script will:




1 Dump MySQL database using mysqldump
2 Archive XenForo files
3 Compress everything
4 Upload to S3
5 Verify upload
6 Delete local copy



And it will run with low system priority so the forum won't lag.


Example CPU priority:




nice -n 19
ionice -c2 -n7



This makes backups almost invisible to the server load.




Step 3 — Safety Features I'll Include​


The script I give you will include:


✔ lock file (prevents multiple backups running)
✔ upload verification
✔ error logging
✔ timestamped backups
✔ safe cleanup
✔ bandwidth-friendly upload
✔ optional Discord/email alerting (if you want)




Step 4 — Example Result (what you'll end up with)​


Backup file name example:




xenforo-backup-2026-03-14.tar.gz



Stored in S3 like:




s3://my-xenforo-backups/daily/xenforo-backup-2026-03-14.tar.gz





Step 5 — After you answer the questions​


I'll give you:


1️⃣ Full backup script
2️⃣ Install commands for AlmaLinux 9
3️⃣ AWS S3 setup
4️⃣ Cron job setup
5️⃣ Test procedure
6️⃣ Recovery procedure (very important)




Bonus​


If you want, I can also show you a much more advanced system used by large forums:


  • incremental backups
  • rclone instead of AWS CLI
  • multi-region storage
  • encrypted backups
  • automatic pruning

Much safer for big XenForo communities.




Reply with:




Xenforo path:
Database name:
Database user:
Database password:
Database host:
S3 bucket:
S3 region:
Temporary backup folder:
AWS CLI installed: yes/no
Server RAM:
Backup type: simple / daily+weekly



Then I'll build the exact script tailored to your server. 🚀
 
Back
Top Bottom