MyBB Community Forums

Full Version: Backing up the database?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm stupid, I know. >_<

But anyway, I can't find the function to back up the database. Any help?
There isn't a way of doing this through MyBB, so you'll need to login to phpMyAdmin or a similar tool and use the "Backup" feature.
This feature and a database restore feature would be really handy if it were added to myBB. The link could be placed in Maintenance area.

I do a lot of backing up before I install or attempt the make something. And I hate going into phpMyAdmin each time to back-up.
i wonder if there's a mod to do this?
Well see, that's the thing, I don't have access to phpMA on my server. So in event of a database breakdown, I'd lose everything. =/
I have added this mod to my forums, but it is still in development. I will maybe release it. I just have alot of custom mods on my site to make it unique.
Aino Minako Wrote:Well see, that's the thing, I don't have access to phpMA on my server. So in event of a database breakdown, I'd lose everything. =/

How do you do your databases than? I have C-Panel and I can backup my databases thru phpadmin or thru a link called Site Management on the front page of C-Panel.
yukisho Wrote:I have added this mod to my forums, but it is still in development. I will maybe release it. I just have alot of custom mods on my site to make it unique.

How is the develloping of the backup feature is going on?? It would be really handy for the change from RC4 to gold, so at a worst case you can go back Smile, or is there probably anyboday else also working on a solution???
I actually have a php script running through cron every night to backup my database.

Here's the script (rather simple):

<?php
// Mysql Database Information:
$database = '';   // name of the database.
$username = '';  // username with access to database.
$password = '';  // password for username.
// Database Backup Filename & Location
$backupto = '/path/to/backup/dir/forums';  // absolute path to folder containing database - no trailing slash.
$backupas = $database.'.'.date("F-j") . '.sql' . '.gz';
// Perform backup
$backupcommand = "mysqldump -u$username -p$password $database | gzip >$backupto/$backupas";
passthru ("$backupcommand", $error);
if($error) {
   echo ("Problem: $error\n" ); exit;
}
?>

Please note that this wont work if your host has safe mode enabled.
Thanx, I tried it out, created an php file and run it, it gave me problem 1. Does this mean safe mode is not enabled???
Pages: 1 2