How do I backup my forums? · Blog

The recommended method is listed below; this is not the only method but it's what tends to go the fastest (especially with larger forums). We only recommend using the built in "backup database" tool as a last resort as it'll take forever to run on even a moderately small forum.

Please Note: MySQL File Creation times, Compression Times, Extraction Times, and Download Times will vary based on Server Resources, Database and Archive size, and Internet Connection Speed.

MySQL Backup in Unix or Linux
If you're on a Linux/Unix machine, you can use the Command Line tools via SSH to create a database dump (backup of the mysql database) by inserting the command:
mysqldump -uusername -ppassword databasename > databasename.sql

If you wish to compress the above output so that it's easier to transfer around, then you can do:
tar -cvpzf databasename.tgz databasename.sql

If you've compressed the output and would like to decompress it, then you can run:
tar -xzvf databasename.tgz

(the output will extract as databasename/databasename.sql)

And to restore said backup, after you purge data out of the MySQL database:
mysql -h localhost -uusername -ppassword databasename < databasename.sql

File Backup in Linux or Unix
You can easily backup your entire UBB.Threads directory (with or without the cache) with a quick one liner:

Without the Cache:
tar -cvpzf forum_backup.tgz /path/to/your/forum --exclude-from=/path/to/your/forum/cache

With the Cache:
tar -cvpzf forum_backup.tgz /path/to/your/forum

Extracting the Backup:
tar -xzvf forum_backup.tgz

PHPMyAdmin Notice
I myself don't recommend that you create your database backup from within PHPMyAdmin (or any other web script) as it can take much longer than the aforementioned methods as you're hopping through the webserver to do something that it doesn't really need to be doing.

Another issue with using PHP scripts to create a database dump is that you could end up hitting the "PHP Maximum Execution Time" limit which is usually about 60 seconds... If this is the case, the archive you're presented with will generally not be complete and you'll end up with missing records. This is generally not a problem with databases under 100mb or so; but is still something one would have to worry about.
Posted By Gremelin Posted on July 14th, 2007


( Posted)
Request a Quote
Please feel free to Request a Quote at any time.

By requesting a quote you allow us to adjust pricing for your product on a per-project basis. Note that most of the prices on our pricing page are just our "common" pricing and can vary on a per project basis. It will also allow us to add any per project discounts where we see fit (non-profit organizations, affiliations, etc).

If your "type" of project isn't listed in our menu's to the left, please Request a Quote; we can do much more than what is listed however building pages for it all would take a great while.
Financing Available
We utilize StableHost for the hosting of our all of our VPS'. They're also #1 host that we recommend to every one of our clients, friends, and family. For more Web Hosting recommendations, please see our Recommended Hosts page!

StableHost Web Hosting

For EMail hosting we recommend G Suite (Formerly Google Apps and Google for Business).
Buy Us a Coffee