Quick BB
PHP 8.2+ & MySQL Buy license · $79.95
Maintenance

How to Back Up and Restore Your Forum

What to back up on a PHP forum, how often, where to keep copies off the server, how to test backups and how to restore without losing more data.

Updated 5 minute read The Quick BB team

A forum is years of conversations that cannot be recreated if they are lost. Hardware failures, bad updates, hacked accounts and simple mistakes happen to every site eventually, and the only real protection is a tested backup. This guide explains what to back up, how often, where to store copies, and how to restore without making things worse.

What a forum backup must include

A self-hosted PHP forum has three parts, and a complete backup covers all of them:

PartWhat it containsHow often it changes
DatabaseMembers, posts, threads, private messages, settings, skins, reputation, logsConstantly
UploadsAttachments, avatars, skin logos, ad bannersDaily on active boards
Software files and configThe forum's PHP files and its configuration file with database detailsOnly when you upgrade or change settings

The database is the heart of it. Without it, you have an empty forum. Without the uploads, posts survive but attachments and avatars break. The software files can be downloaded again, but keep a copy of your configuration file somewhere safe, because it holds the database connection details.

How often to back up

Match the schedule to how much content you could stand to lose:

  • Busy forums: a database backup every day, uploads at least weekly.
  • Quiet forums: a database backup weekly is often enough, plus uploads monthly.
  • Before any risky change: always take a fresh backup before upgrading, importing, installing a plugin, mass-moving threads or running a bulk spam cleanup.

Keep several generations, not just the latest. If a problem goes unnoticed for a week (a spam wave, a deleted forum, corrupted data), you need a backup from before it started. A simple retention scheme is seven daily copies, four weekly copies and a few monthly ones.

Store copies off the server

A backup that only lives on the same server is not much of a backup. If the server fails, is compromised or the hosting account is closed, the backup goes with it. A widely used rule of thumb is to keep three copies of your data, on two different types of storage, with one copy off-site. For a forum owner on shared hosting, that can be as simple as:

  1. The live forum on the server.
  2. A backup downloaded to your own computer or an external drive.
  3. A copy in a cloud storage account that is not tied to your hosting.

Protect downloaded backups. They contain member email addresses, password hashes and private messages, so store them somewhere access-controlled and delete old copies you no longer need.

Backing up with Quick BB

Quick BB has built-in backups in the Admin CP, so you do not need command-line access. You can back up the database with optional uploads, view backup history and set retention so old backups are cleaned up automatically. Backups are chunked for shared hosting, which means large databases are processed in pieces rather than in one long request that could hit the host's time limits.

After each backup, download a copy and move it off the server as described above. If your host also offers its own backups through your hosting control panel (often cPanel), treat those as an extra layer, not your only one, since you cannot always choose when they run or how long they are kept.

Manual backups as a fallback

It is worth knowing how to take a backup by hand in case the forum itself will not load:

  • Database: most hosts include a web-based database tool in the control panel. Select the forum database and use its export function to save an SQL file. If you have shell access, the mysqldump command does the same job.
  • Files and uploads: use FTP or the host's file manager to download the forum folder. Many file managers can compress a folder into a ZIP first, which is much faster to download.

Make sure exports use the utf8mb4 character set, so emoji and non-English text survive the round trip.

Test your backups

An untested backup is a hope, not a plan. At least a few times a year:

  1. Create a separate test database (see how to create a MySQL database for a forum).
  2. Restore the backup into it, ideally on a test subdomain or a local server.
  3. Check that recent threads, private messages, attachments and avatars are there.
  4. Note how long the restore took, so you know what to expect in a real emergency.

How to restore safely

When something goes wrong, the urge is to restore immediately. Slow down for a few minutes first:

  1. Close the forum or put it in maintenance. This stops new posts being written that will be overwritten by the restore.
  2. Back up the current state, even if it is broken. You may need data from it later, for example posts made after the last good backup.
  3. Pick the right backup. Choose the newest one from before the problem started.
  4. Restore the database, then uploads. Restore the files only if they were damaged or modified.
  5. Check, then reopen. Log in as admin, check recent content and settings, then reopen the board and tell members what happened and what time period was lost.

Quick BB includes a protected restore alongside its backups, so restoring is not something that can be triggered casually. Because admins are required to use two-factor authentication by default, a stolen admin password alone is not enough to get into the Admin CP; see two-factor authentication for forum admins.

If the restore follows a hack, change the database password, admin passwords and any SMTP password before reopening, and review the forum security checklist. Restoring old data does not remove the weakness that let the attacker in.

A backup checklist

  • Database backed up on a schedule that matches your activity level.
  • Uploads included at least weekly.
  • Configuration file copied somewhere safe.
  • At least one copy off the server and away from your hosting account.
  • Several generations kept, not only the newest.
  • A fresh backup before every upgrade, import or bulk change.
  • A test restore every few months.

Backups are also the first step in an upgrade or a move to a new host, so getting this routine right makes every other maintenance task less stressful.

Frequently asked questions

How often should I back up my forum?

Busy forums should back up the database daily and uploads at least weekly. Quiet forums can often back up weekly, and every forum should take a fresh backup before any upgrade or bulk change.

Are my host's backups enough?

Treat them as an extra layer. Keep your own copies off the server, because host backups may not run when you need them or be kept long enough.

What should I do before restoring a backup?

Close the forum, back up the current state even if it is broken, and choose the newest backup from before the problem started.

Get three guides like this every month, plus software update notices.Subscribe →